EDUCBA

EDUCBA

MENUMENU
  • Blog
  • Free Courses
  • All Courses
  • All in One Bundle
  • Login
Home Data Science Data Science Tutorials Logstash Tutorial Logstash Stdout

Logstash Stdout

Logstash Stdout

Introduction to Logstash stdout

stdout is the standard output data plugin of Logstash, which has its latest version launched of 3.1.4, which was made in April 2018. This plugin helps display and print the output, which is in the format of STDOUT as the resultant of the shell that executes in the Logstash pipelines’ background. After the data is passed through the processes of ingestion and filtering, it makes the provision and allowance of accessing the events instantly, making the process of debugging the configurations of plugins easier and more convenient.

In this article, we will look at what logstash stdout is and study its subtopics, including What logstash stdout is and how to use it and Logstash stdout and Logstash stdout command, Logstash stdout plugins, and a Conclusion about the same.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

What is Logstash stdout?

To print the output, which is in the format of STDOUT, to the shell of the Logstash, we can use the simple plugin available in Logstash named stdout. Whenever there is a need to debug the working and execution of the plugin and its configurations, the stdout plugin’s output is of great help. Moreover, after the event data passes through various filters and the inputs, enabling access to the event data is done by Logstash, which makes it helpful in the debugging process.

How to use Logstash stdout?

Let us consider one example to understand how the configuration of the output plugin to stdout proves helpful. Viewing the output results of pipelines inside the event that are used while performing quick iteration uses the following output configuration and the -e command option available in Logstash.

Output {
Stdout {}
}

When the above output configuration is used in ruby-debug, which is done by default when using codec in the standard output plugin of Logstash along with the library name awesome_print of ruby gives the result as the output of event data.

When the stdout mentions the codec as json, the output results in the structured event data format in JSON format. The configuration of stdout in the case of json should be set as below to get the event data in JSON structured format –

Output {
Stdout {codec => json}
}

Logstash stdout command

The logstash-stdout command is used for printing the event and its data o the standard output, and the complete details can be acquired in the git repository of Logstash-output-stdout, which can be found on this link.

Let us consider a sample example of the configuration file contents of the pipeline.conf file when used for implementing multiple outputs in it –

input {
linkedIn {
consumer_key => "sampleEducbaConsumerKey"
consumer_secret => "sampleEducbaSecret"
keywords => ["business"] oauth_token => "sampleEducbaAccessToken"
oauth_token_secret => "sampleEducbaAccessTokenSecret"
}
beats {
port => "5432"
}
}
output {
stdout
{
codec => json_lines {}
}
elasticsearch {
hosts => [“sample Ip address: port number”] }
file {
codec => json_lines {}
path => "/educba/sample/filepath"
}
}

Now, to verify whether the configurations are set as expected, we can execute the following command –

bin/Logstash -f pipeline.conf --config.test_and_exit

Execution of the above command gives the following output –

Logstash Stdout output 1

Logstash stdout plugins

We can use Logstash stdout by specifying the same in the pipeline configuration file.cnf. Along with that, we can even go for specifying various options related to configurations. The below table contains the list of all the supported configuration options for the stdout plugin –

Configuration option setting Type of input data Optional/ Required
Id String value Optional
Enable_metric Boolean Optional
Codec Codec Optional

Codec – The codec configuration setting accepts the input of type codec and, when not specified, contains the default value as rubydebug. This is used for the process of getting the correct output data. The codec configuration setting in output acts as the technique to encode the data before the departure of output. While doing so, it is not even necessary to segregate the filters inside the pipelines of Logstash.

Id – This configuration setting option accepts the string value and, by default, when not specified, does not contain any value. When specified, it should be a unique identifier for the plugin. When we do not specify any value for this configuration setting, it will result in internal automated value generation by Logstash. It is always a good practice to mention the value of id in our configurations. If there are two or more multiple plugins of the same type, it will be useful for identifying each one individually. Let us consider an example in case we have two outputs of stdout. Using the specification of the id value for both plugins will be useful for Logstash in the monitoring process when we use API of monitoring. The sample of specification of id for stdout plugin is as shown below-

Output {
Stdout{
Id => “sample_educba_plugin_identifier”
}
}

Please note that when going for the variable substitution of the configuration setting of id, it will only provide the support for the environment variables and not the personal store values.

Enable_metric – It accepts the Boolean value and, when not specified, contains the default value of true. When we specify this configuration setting option, we can enable or disable metrics logging corresponding to a particular plugin. For example, the default behavior of the Logstash is such that it keeps track and records all the metrics; however, we can disable this behavior for the particular plugin(s) if we want.

Conclusion

Logstash stdout plugin is used for printing the event’s data to the standard output. We can even use configuration setting options such as id, codec, or enable_metric, which help define the details of the plugin. We can even print the event data in standard output in the format of JSON structured data when we set the codec to json.

Recommended Articles

This is a guide to Logstash Stdout. Here we discuss Logstash stdout and study its subtopics, including What stdout is. You may also look at the following articles to learn more –

  1. Logstash Alternatives
  2. Logstash Version
  3. Types of Methodology
  4. What is Logstash?
All in One Excel VBA Bundle
500+ Hours of HD Videos
15 Learning Paths
120+ Courses
Verifiable Certificate of Completion
Lifetime Access
Financial Analyst Masters Training Program
1000+ Hours of HD Videos
43 Learning Paths
250+ Courses
Verifiable Certificate of Completion
Lifetime Access
All in One Data Science Bundle
1500+ Hour of HD Videos
80 Learning Paths
360+ Courses
Verifiable Certificate of Completion
Lifetime Access
All in One Software Development Bundle
3000+ Hours of HD Videos
149 Learning Paths
600+ Courses
Verifiable Certificate of Completion
Lifetime Access
Primary Sidebar
All in One Data Science Bundle1500+ Hour of HD Videos | 80 Learning Paths | 360+ Courses | Verifiable Certificate of Completion | Lifetime Access
Financial Analyst Masters Training Program1000+ Hours of HD Videos | 43 Learning Paths | 250+ Courses | Verifiable Certificate of Completion | Lifetime Access
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more