I use python tail log file, and publish to logstash(tcp input).
Because my system problem(#46708), I can't use filebeat
, and filebeat have a very useful setting fields
.
How can I achieve this features by python.
I use python tail log file, and publish to logstash(tcp input).
Because my system problem(#46708), I can't use filebeat
, and filebeat have a very useful setting fields
.
How can I achieve this features by python.
You would either need to use the add_fields
option in the input, or use grok.
I suggest that you instead of sending the raw log file contents construct JSON strings containing whatever fields you like (including one field with the log message) and send that to Logstash. Use a json (or json_lines?) codec to deserialize the JSON string.
Yes, you are right. Thank for your suggest.
© 2020. All Rights Reserved - Elasticsearch
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.