elasticsearch - How do I increment my count field of my document from logstash? -
i want update 1 field of document/log in elasticsearch logstash.
my logstash conf file
input { http { host => "127.0.0.1" # default: 0.0.0.0 port => 31311 # default: 8080 } } output { stdout { codec => json }, elasticsearch { action => "update" bind_host => "127.0.0.1" bind_port => 9200 document_id => "et00009682" index => "in12" type => "event" } }
i want increment count field 1 how specify in output of logstash.
note: know update need use script
"script" : "ctx._source.count += 1"
but not sure place in output of logstash?
kindly thanks
you can conf:
output { stdout { codec => json }, elasticsearch { action => "update" bind_host => "127.0.0.1" bind_port => 9200 document_id => "et00009682" index => "in12" type => "event" doc_as_upsert => true script => "ctx._source.count += 1" script_lang => "groovy" script_type => "inline" } }
Comments
Post a Comment