Getting timestamp of event from file name in logstash

心已入冬 提交于 2019-12-22 12:18:10

问题


We have a process that writes events to a file, without a timestamp. The file names themselves are suffixed with a timestamp, which is the timestamp that should be used for all the events in the file. Now, I am trying to parse the file by using the input file plugin of logstash. Is there a way by which I could get the name of the file to a field, so that I can then use the gsub filter to extract out the timestamp and then use the date filter to set the timestamp to the event?


回答1:


I had a similar need, and asked this question again - so you can find a more up-to-date answer in this question thanks to Jettro Coenradie :)



来源:https://stackoverflow.com/questions/12346590/getting-timestamp-of-event-from-file-name-in-logstash

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