Filebeat, Commandline Arguments Configuration


Environment and Commandline arguments setting to filebeat.yml

We can use environment variables and arguments from command line  references in the filebeat.yml file to set values or fields that need to be configurable during deployment. To configure fields and values use like this:

${VAR1}

Where VAR1 is the name of the environment variable or passing values from command line.

These configured values will replaced on start up by the value of environment variable or command line arguments. These configured fields are case sensitive if value not found will fail on parsing so better configure values with default value as given below.

${VAR1:default_value}

We pass command line arguments to set configured values with option -E with argument name.

We have configured in below file variable fields for server, kafkaHost and topic in below sample configuration file that way we can set other fields also as per requirement.

Use below command to run this sample configuration file:

./filebeat -c filebeat.yml -d publish -E server=server1 -E kafkaHost=IP:PORT -E topicName=QC-TEST

For example above commandline arguments will pass to filebeat.yml file for below settings.

Prospectors Settings :

filebeat.prospectors:
- input_type: log
paths:
- /opt/app/${server}/logs/app1-debug*.log*
fields_under_root: true

Kafka Output Settings:

output.kafka:
#enabled: true
hosts: ["${kafkaHost}"]
topic: ${topicName}

Integration

Complete Integration Example Filebeat, Kafka, Logstash, Elasticsearch and Kibana

Read More

To read more on Filebeat topics, sample configuration files and integration with other systems with example follow link Filebeat Tutorial  and  Filebeat Issues.To Know more about YAML follow link YAML Tutorials.

Leave you feedback to enhance more on this topic so that make it more helpful for others.

Advertisements

About Saurabh Gupta

My Name is Saurabh Gupta, I have approx. 11 Year of experience in Information Technology World manly in Java/J2EE. During this time I have worked with multiple organization with different client, so many technology, frameworks etc.
This entry was posted in Filebeat and tagged , , . Bookmark the permalink.

12 Responses to Filebeat, Commandline Arguments Configuration

  1. Pingback: Sample filebeat.yml file for Prospectors, Elasticsearch Output and Logging Configuration | Facing Issues On IT

  2. Pingback: Sample filebeat.yml file for Prospectors,Multiline and Logging Configuration | Facing Issues On IT

  3. Pingback: Sample filebeat.yml file for Prospectors ,Kafka Output and Logging Configuration | Facing Issues On IT

  4. Pingback: Sample filebeat.yml file for Prospectors and Logging Configuration | Facing Issues On IT

  5. Pingback: Filebeat Configuration Changes for Elasticsearch Output | Facing Issues On IT

  6. Pingback: Filebeat Configuration Changes for Multiline Logs Handling | Facing Issues On IT

  7. Pingback: Filebeat Configuration Changes for Prospectors to Read Log files | Facing Issues On IT

  8. Pingback: Filebeat Configuration Changes for Kafka Output | Facing Issues On IT

  9. Pingback: Filebeat Configuration Changes for Logstash Output | Facing Issues On IT

  10. Pingback: Filebeat Introduction | Facing Issues On IT

  11. Pingback: Filebeat Configuration Changes for Logging | Facing Issues On IT

  12. Pingback: Steps to Download,Installation and Start/Run Filebeat | Facing Issues On IT

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s