Problem: document count on elasticsearch doesn't change
Note: I'm able to get filebeat=>logstash=>elasticsearch working ok. When I try to add the kafka broker and adjust input/output accordingly, the content consumed by logstash doesn't output to elasticsearch.
Is the data in kafka? Is it pulling it from there?
filebeat pushes to kafka. the topic 'clusterlogs' was automatically created in kind.
the data is in kafka as shown via bin/kafka-console-consumer.sh
when i turn on debugging in logstash, i can see what's mentioned in the DEBUG log that i linked to. the DEBUG log, to me, plainly shows data being pulled. Example:
[2017-02-10T22:11:30,199][DEBUG][logstash.pipeline ] filter received {"event"=>
{"@timestamp"=>2017-02-10T22:11:30.159Z, "log_origin"=>"kafka", "@version"=>"1",
"message"=>"{\"@timestamp\":\"2017-02-10T22:11:16.991Z\",\"beat\":
{\"hostname\":\"applicationbhv6.\",\"name\":\"applicationbhv6.\",\"version\":\"5.2.0\"},
\"input_type\":\"log\",\"message\":\" WARN [ScheduledTasks:1] 2017-02-10 16:11:16,486
GCInspector.java (line 142) Heap is 0.981591859186788 full. You may need to reduce memtable
and/or cache sizes. app2 will now flush up to the two largest memtables to free up memory.
Adjust flush_largest_memtables_at threshold in app2.yaml if you don't want app2 to do this
automatically\",\"offset\":9778327,\"source\":\"/var/log/app2/system.log\",
\"type\":\"clusterlogs\"}"}}
the issue is the logstash doesn't output to elasticsearch.
in the event someone else runs into this it looks like when one uses the kafka input plugin, logstash doesn't expand @metadata fields anymore. to work around this, i'm using ansible vars since i'm templating these files out from an ansible playbook. You may have to set them to static values and manage accordingly.
logstash config:
output_elastic (@metadata doesn't parse):
# index => "%{[@metadata][type]}-%{+YYYY.MM.dd}"
# ^^^ changed to ...
index => "filebeat-%{+YYYY.MM.dd}"
input kafka
the doc_and_topic_via_ansible var is set via ansible.
this creates the elasticsearch index as expected and everything works with one minor exception. Events go into elasticsearch with _type set as the non-expanded value below:
_type %{[@metadata][type]}
instead of the expected value of "filebeat-" as expected by setting that field in filebeat.yml shipper running on endpoint machines with document_type in the input section.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.