Created
August 22, 2019 01:46
-
-
Save dongyi/ab645e942d3c28f9c7df0823c510a65e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
tcp { | |
port => 5000 | |
} | |
} | |
## Add your filters / logstash plugins configuration here | |
filter { | |
kv { | |
source => "message" | |
field_split => "[,\s]" | |
value_split => ":" | |
} | |
ruby { | |
code => " | |
hash = event.to_hash | |
hash.each { |key,value| | |
event.set(key.gsub('kv.', '').gsub('\"', ''), value) | |
} | |
" | |
} | |
} | |
output { | |
elasticsearch { | |
hosts => "elasticsearch:9200" | |
user => "elastic" | |
password => "changeme" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment