Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion logstash_deploy/logstash/outputs/lucidworks_solr_lsv122.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class LogStash::Outputs::LucidWorks < LogStash::Outputs::Base
# Prefix will replace the @ in logstash fieldnames @timestash and @version.
config :field_prefix, :validate => :string, :default => "logstash_"

# Webapp name
config :webapp_name, :validate => :string, :default => "solr"

@lucidworks
@solrFieldCreationParams

Expand Down Expand Up @@ -73,7 +76,7 @@ def register

@solrFieldCreationParams = java.util.HashMap.new(@solrFieldCreationParams)

@lucidworks.init(@collection_host, @collection_port, @collection_name)
@lucidworks.init(@collection_host, @collection_port, @collection_name, false, @webapp_name)
end # def register

public
Expand Down
5 changes: 4 additions & 1 deletion logstash_deploy/logstash/outputs/lucidworks_solr_lsv133.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class LogStash::Outputs::LucidWorks < LogStash::Outputs::Base
# Prefix will replace the @ in logstash fieldnames @timestash and @version.
config :field_prefix, :validate => :string, :default => "logstash_"

# Webapp name
config :webapp_name, :validate => :string, :default => "solr"

# Solr solrconfig.xml can be configured to automatically commit documents after a
# specified amount of time or after receipt of a maximum number of documents. For convenience
# allow the logger to override this setting for use in cases where the site either isn't
Expand Down Expand Up @@ -62,7 +65,7 @@ def register
# have Solr create them.
#

@lucidworks.init(@collection_host, @collection_port, @collection_name, @force_commit)
@lucidworks.init(@collection_host, @collection_port, @collection_name, @force_commit, @webapp_name)

@lucidworks.createSchemaField(@field_prefix + "timestamp", "\"type\":\"tdate\",\"name\":\"" + @field_prefix + "timestamp" + "\",\"stored\":true,\"indexed\":true")
@lucidworks.createSchemaField(@field_prefix + "version", "\"type\":\"long\",\"name\":\"" + @field_prefix + "version" + "\",\"stored\":true,\"indexed\":true")
Expand Down
6 changes: 3 additions & 3 deletions src/LWSolrLogCollectionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private enum SOLR_RSP {
public int getValue() { return id; }
}

public void init(String host, int pt, String collection, boolean forceCommit) {
public void init(String host, int pt, String collection, boolean forceCommit, String webappName) {
String port = String.valueOf(pt);
String update = "/update";

Expand All @@ -52,8 +52,8 @@ public void init(String host, int pt, String collection, boolean forceCommit) {
// Note the Solr documentation examples do not include the collection. But if
// if collection is left out then new records are not added to the index because
// the fields are not found even though they do somehow appear in the managed-schema file.
fieldsPath = "http://" + host + ":" + port + "/solr/" + collection + "/schema/fields";
addNewDocPath = "http://" + host + ":" + port + "/solr/" + collection + update;
fieldsPath = "http://" + host + ":" + port + "/" + webappName + "/" + collection + "/schema/fields";
addNewDocPath = "http://" + host + ":" + port + "/" + webappName + "/" + collection + update;
}

/**
Expand Down