Filebeat - parse fields from message line

元气小坏坏 提交于 2020-01-02 03:06:22

问题


I am using Filebeat to ship log data from my local txt files into Elasticsearch, and I want to add some fields from the message line to the event - like timestamp and log level. For example here is one of my log lines:

2016-09-22 13:51:02,877 INFO 'start myservice service'

My question is: Can I do that by Filebeat -> Elasticsearch or must I go through Logstash?


回答1:


You can use Filebeat -> Elasticsearch if you make use of the Ingest Node feature in Elasticsearch 5.0. Otherwise, yes, you need to use Logstash.

In both cases you would use a grok filter to parse the message line into structured data. Also you'll want to use a date to parse and normalize the date.



来源:https://stackoverflow.com/questions/40460830/filebeat-parse-fields-from-message-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!