logstash - Possible to specify two different codecs in lumberjack? -
i have put elk stack, having trouble regarding logstash configuration in /etc/logstash/conf.d have 2 input sources being forwarded 1 linux server, has logstash forwarder installed on "files" looking like:
{ "paths": ["/var/log/syslog","/var/log/auth.log"], "fields": { "type": "syslog" } }, { "paths": ["/var/log/osquery/osqueryd.results.log"], "fields": { "type": "osquery_json" } } as can see, 1 input osquery output (json formatted), , other syslog. current config logstash osquery.conf:
input { lumberjack { port => 5003 ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt" ssl_key => "/etc/pki/tls/private/logstash-forwarder.key" codec => "json" } } filter { if [type] == "osquery_json" { date { match => [ "unixtime", "unix" ] } } } output { elasticsearch { host => localhost } stdout { codec => rubydebug } } which works fine 1 input source, not know how add other syslog input source same config, "codec" field in input -- can't change syslog...
i planning on adding input source in windows log format not being forwarded logstash forwarder. there anyway structure differently?
it's better remove codec input if going handling different codecs on same input:
input { lumberjack { port => 5003 ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt" ssl_key => "/etc/pki/tls/private/logstash-forwarder.key" } } filter { if [type] == "osquery_json" { json { source => "field_name_the_json_encoded_data_is_stored_in" } date { match => [ "unixtime", "unix" ] } } if [type] == "syslog" { } } output { elasticsearch { host => localhost } stdout { codec => rubydebug } } then need decide want syslog messages.
i suggest splitting config multiple files. tend to use 01-filename.conf - 10-filename.conf inputs, 11-29 filters , above outputs. these files loaded in logstash in order printed in ls.
Comments
Post a Comment