Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FileBeat directly to ELS or via LogStash?

We are installing ELS and Kibana for log aggregation/analysis. The first system to use it is greenfield so we output structured logs from the services that make up our system. Given that we don't need to add structure to our logs I was planning on using FileBeat to ship the logs directly to ELS and not use LogStash. Is this a sensible option or does LogStash have value over and above parsing that we might need? If we do use LogStash can I use that to harvest log files or should I still use FileBeat to pump the logs to LogStash?

like image 671
Myles McDonnell Avatar asked Oct 05 '16 12:10

Myles McDonnell


People also ask

How does Filebeat work with Logstash?

Filebeat is a lightweight shipper for forwarding and centralizing log data. Installed as an agent on your servers, Filebeat monitors the log files or locations that you specify, collects log events, and forwards them either to Elasticsearch or Logstash for indexing.

Do I need Logstash with Filebeat?

You can now use filebeat to send logs to elasticsearch directly or logstash (without a logstash agent, but still need a logstash server of course).


2 Answers

Is this a sensible option or does LogStash have value over and above parsing that we might need?

Deciding to use Logstash or not, in your case, depends on whether you need to treat the logs before inserting them into ES.

In addition to parsing (which is apparently useless in your use case), you can use Logstash to add a location with the geoip filter, parse a date with the date filter, replace a word with another, replace a field with a hash, etc...

You can have a look at the available filters here.

If we do use LogStash can I use that to harvest log files or should I still use FileBeat to pump the logs to LogStash?

If you need Logstash and can afford to run it on the machine where your logs are, you can avoid using Filebeat, by using the file input.

But keep in mind that Logstash, especially if used for parsing, can consume a lot of resources. It is better to have it on another machine and use Filebeat to pump the logs to Logstash.

like image 118
baudsp Avatar answered Oct 20 '22 18:10

baudsp


Logstash is useful if you need to aggregate logs from many servers and apply some common transformations and filtering to your events.

If your log events are already structured and you are ok with indexing them directly, then you can definitely have Filebeat send them directly to ES. If ES goes down (e.g. for maintenance), Filebeat will retry until it can successfully send the events.

like image 36
Val Avatar answered Oct 20 '22 19:10

Val