Logstash configuration file

Configuration file is the key to run Logstash. As Logstash requires the configuration file to be created/updated it is important to have an efficient and flexible configuration that can be easily changed as and when required. Let's have a look at some of the best practices that we should follow.

Categorizing multiple sources of data

When you have multiple different sources of data that you want to gather and uncover insights from them, it is best to categorize each source of data by adding a type to each of the different sources.

We can take a look at the following example:

input { file { path => "/path/to/directory/" type => "datanode" } file { path => "/path/to/directory/" type => "hbase" } file { path => "/path/to/directory/" ...

Get Mastering Elastic Stack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.