-
-
Save Analect/9d954d1326ce0241f3d6 to your computer and use it in GitHub Desktop.
logstash config file for capturing kafka messages
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 { | |
kafka { | |
zk_connect => "172.17.0.215:2181" | |
group_id => "logstash" | |
topic_id => "request" | |
reset_beginning => false | |
consumer_threads => 1 | |
queue_size => 20 | |
rebalance_max_retries => 4 | |
rebalance_backoff_ms => 2000 | |
consumer_timeout_ms => -1 | |
consumer_restart_on_error => true | |
consumer_restart_sleep_ms => 0 | |
codec => json | |
} | |
} | |
input { | |
kafka { | |
zk_connect => "172.17.0.215:2181" | |
group_id => "logstash" | |
topic_id => "response" | |
reset_beginning => false | |
consumer_threads => 1 | |
queue_size => 20 | |
rebalance_max_retries => 4 | |
rebalance_backoff_ms => 2000 | |
consumer_timeout_ms => -1 | |
consumer_restart_on_error => true | |
consumer_restart_sleep_ms => 0 | |
codec => json | |
} | |
} | |
filter { | |
if [response][compressed] { | |
ruby { | |
code => " | |
require 'zlib'; | |
temp_payload = event['response']['payload'] | |
#buf_payload = new_payload.pack('C*') if new_payload.is_a?(Array) | |
#puts compressYN | |
#puts new_payload.class | |
event['response']['payload_decoded']= Zlib::Inflate.inflate(temp_payload.to_a.pack('C*')) | |
" | |
} | |
} | |
} | |
output { | |
stdout { codec => rubydebug } | |
elasticsearch { | |
protocol => "http" | |
host => "localhost" | |
index => "logs" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment