Tried to pass multiple conf file not working


(murali krishna) #1

I. had passed as below to Logstash. It is not taking.

I. have to pass multiple input files. to Logstash , so I had created multiple conf files as below
-------I. passed like below
bin/logstash -f logstash-filter*.conf

bin/logstash -f logstash-filter10.conf -f logstash-filter11.conf. -f logstash-filter12.conf. -f logstash-filter13.conf
----------------logstash-filter*.conf like below
input {

file {
path => "/Users/krishna/Elastic-kibana-logstash/logstash-6.3.0/input/Autosys-Logs.txt"
start_position => "beginning"
type => "apache"
}

}

output {
elasticsearch { hosts => ["localhost:9200"]
index => "elasticlog-demo"
}
stdout { codec => rubydebug }
}
.


(Magnus Bäck) #2

If you have multiple config files put them in a directory and pass the path to that directory via -f.


(murali krishna) #3

I had tried. as below by putting multiple config files in folder and passing folder with -f option. It throws error.
----------I passed like this
bin/logstash -f fileconfig

[2018-07-03T15:38:42,953][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, input, filter, output at line 33, column 1 (byte 688) after ", :backtrace=>["/Users/krishna/Elastic-kibana-logstash/logsta


(Magnus Bäck) #4

That indicates that one or more files in the directory is invalid.


(murali krishna) #5

my two files in the folder are as below
input {

  file {
      path => "/Users/krishna/Elastic-kibana-logstash/logstash-6.3.0/input/Storm_supervisor-Logs.csv"
      start_position => "beginning"
      type => "apache"
   }

}
filter {

  grok {
        match => {
                  "message" => "%{WORD:ERROR} "
                }
      }

   }

output {
elasticsearch { hosts => ["localhost:9200"]
index => "elasticlog-demo"
}
stdout { codec => rubydebug }
}
--------another file
nput {
file {
path => "/Users/krishna/Elastic-kibana-logstash/logstash-6.3.0/input/ETL-Logs.txt"
start_position => "begining"
type => "apache"
}
}
}

output {
elasticsearch { hosts => ["localhost:9200"]
index => "elasticlog-demo"
}
stdout { codec => rubydebug }
}


(murali krishna) #6

I had shown my conf files in folder. Is there a way to put two input csv files in a single .conf file ? I could not do so. So I put two .conf files in folder and passed folder nam as input


(Magnus Bäck) #7

Logstash merges all configuration files found in a directory. It doesn't matter if you have all your inputs, filters, and output in a single file or if you split them in multiple files.

In your case, keep in mind that you have to elasticsearch outputs so you'll send all documents to ES twice.


(system) #8

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.