{"id":31083,"date":"2026-12-03T22:04:12","date_gmt":"2026-12-03T22:04:12","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=31083"},"modified":"2026-12-03T22:04:12","modified_gmt":"2026-12-03T22:04:12","slug":"elastic-logstash-input-filter-and-output-example","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/elastic-logstash-input-filter-and-output-example\/","title":{"rendered":"Elastic Logstash Input Filter and Output Example"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A Logstash pipeline has three stages: an <strong>input<\/strong> that reads events, optional <strong>filters<\/strong> that parse and enrich them, and one or more <strong>outputs<\/strong> that send them somewhere. The gist above shows four small configurations: a file-to-file pipeline, a CSV parsing filter, outputs to Elasticsearch, stdout and CSV, and a conditional output skeleton. This page explains each one, fixes the parts that do not run as written, and builds them into a complete pipeline you can test.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/fcced456b7ea2af027017154b47efe9f.js\"><\/script>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">How a Logstash pipeline is structured<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Every Logstash configuration file is made of up to three blocks. Each block holds one or more plugins, and each event passes through them in order: input, then filter, then output. The syntax is Logstash&#039;s own configuration language. It is not YAML, even though the gist files use a <code>.yaml<\/code> extension. Save pipeline files as <code>.conf<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Stage<\/th><th>Purpose<\/th><th>Plugins used above<\/th><\/tr><\/thead><tbody><tr><td>input<\/td><td>Reads raw data and creates events<\/td><td><code>file<\/code><\/td><\/tr><tr><td>filter<\/td><td>Parses, transforms or enriches each event<\/td><td><code>csv<\/code><\/td><\/tr><tr><td>output<\/td><td>Sends events to a destination<\/td><td><code>elasticsearch<\/code>, <code>stdout<\/code>, <code>file<\/code>, <code>csv<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Each event has a <code>message<\/code> field containing the raw line, plus metadata such as <code>@timestamp<\/code>, <code>host<\/code> and <code>log<\/code> (or <code>path<\/code> in older versions). Filters add new fields. Outputs can refer to any field with <code>[fieldname]<\/code> in conditionals or <code>%{fieldname}<\/code> inside strings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding the file input settings<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>path<\/code> is the file or glob to read, for example <code>\/var\/log\/app\/*.log<\/code>. It must be an absolute path. On Windows, use forward slashes: <code>C:\/logs\/app.log<\/code>.<\/li>\n\n\n<li><code>start_position =&gt; &quot;beginning&quot;<\/code> reads existing content of files Logstash has never seen. Without it, Logstash only reads lines appended after startup, which is why test pipelines often seem to do nothing.<\/li>\n\n\n<li><code>sincedb_path =&gt; &quot;\/dev\/null&quot;<\/code> stops Logstash from remembering how far it has read, so the file is processed again on each run. This is useful for testing but wrong for production, where it causes duplicates after every restart. On Windows the equivalent is <code>&quot;NUL&quot;<\/code>.<\/li>\n\n\n<li><code>mode =&gt; &quot;read&quot;<\/code> (optional) treats files as complete batches instead of tailing them. That suits one-off loads such as <code>batch_10day.txt<\/code>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Corrected versions of the gist examples<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The simple input\/output example was written for Logstash 2.3.1 on Windows. <code>ignore_older =&gt; 0<\/code> dates from that era. In current versions of the file input it is a duration in seconds, and setting it to 0 can cause files to be ignored rather than read. Remove it. The output path also needs a sincedb setting that works on Windows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># simple.conf<\/span>\ninput {\n  file {\n    path =&gt; <span class=\"hljs-string\">\"C:\/logstash\/data\/logstash-tutorial-dataset\"<\/span>\n    start_position =&gt; <span class=\"hljs-string\">\"beginning\"<\/span>\n    sincedb_path =&gt; <span class=\"hljs-string\">\"NUL\"<\/span>\n  }\n}\n\noutput {\n  stdout { codec =&gt; rubydebug }\n  file {\n    path =&gt; <span class=\"hljs-string\">\"C:\/logstash\/output\/output.txt\"<\/span>\n  }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">The multi-output example writes the CSV file to <code>path-to-file\\syslogs-...<\/code>. In Logstash strings, a backslash can be read as an escape character, so use forward slashes or a Linux path. The <code>count<\/code> field is only filled in if a filter creates it. Otherwise that column comes out empty.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">output {\n  elasticsearch {\n    hosts =&gt; &#91;<span class=\"hljs-string\">\"http:\/\/localhost:9200\"<\/span>]\n    index =&gt; <span class=\"hljs-string\">\"logstash_index\"<\/span>\n  }\n  stdout {\n    codec =&gt; rubydebug\n  }\n  csv {\n    path =&gt; <span class=\"hljs-string\">\"\/var\/log\/logstash-export\/syslogs-%{+yyyy.MM.dd}.csv\"<\/span>\n    fields =&gt; &#91;<span class=\"hljs-string\">\"@timestamp\"<\/span>, <span class=\"hljs-string\">\"message\"<\/span>, <span class=\"hljs-string\">\"count\"<\/span>]\n  }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The <code>csv_options<\/code> <code>write_headers<\/code>\/<code>headers<\/code> pattern in the gist is passed straight to Ruby&#039;s CSV library, and in some plugin versions it writes the header row again before every event. Check your output file. If the headers repeat, remove <code>csv_options<\/code> and add the header line in a separate step. If the <code>csv<\/code> output plugin is missing, install it with <code>bin\/logstash-plugin install logstash-output-csv<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A complete CSV log pipeline into Elasticsearch<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The filter example splits semicolon-separated batch job lines into named fields. The version below goes one step further. It joins <code>date<\/code> and <code>time<\/code> into a real event timestamp, converts the error code to a number, removes the raw line, and indexes the result. Example input line:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">SUCCESS<\/span>;2022<span class=\"hljs-selector-tag\">-03-01<\/span>;10<span class=\"hljs-selector-pseudo\">:15<\/span><span class=\"hljs-selector-pseudo\">:22<\/span>;<span class=\"hljs-selector-tag\">WS01<\/span>;<span class=\"hljs-selector-tag\">Payroll<\/span>;<span class=\"hljs-selector-tag\">JOB_123<\/span>;0<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># \/usr\/share\/logstash\/pipeline\/batch.conf<\/span>\ninput {\n  file {\n    path =&gt; <span class=\"hljs-string\">\"\/usr\/share\/logstash\/batch_10day.txt\"<\/span>\n    start_position =&gt; <span class=\"hljs-string\">\"beginning\"<\/span>\n    sincedb_path =&gt; <span class=\"hljs-string\">\"\/dev\/null\"<\/span>   <span class=\"hljs-comment\"># testing only<\/span>\n  }\n}\n\nfilter {\n  csv {\n    separator =&gt; <span class=\"hljs-string\">\";\"<\/span>\n    columns =&gt; &#91;<span class=\"hljs-string\">\"status\"<\/span>, <span class=\"hljs-string\">\"date\"<\/span>, <span class=\"hljs-string\">\"time\"<\/span>, <span class=\"hljs-string\">\"workstation\"<\/span>, <span class=\"hljs-string\">\"application\"<\/span>, <span class=\"hljs-string\">\"job\"<\/span>, <span class=\"hljs-string\">\"Error_code\"<\/span>]\n  }\n\n  mutate {\n    add_field =&gt; { <span class=\"hljs-string\">\"job_time\"<\/span> =&gt; <span class=\"hljs-string\">\"%{date} %{time}\"<\/span> }\n    convert   =&gt; { <span class=\"hljs-string\">\"Error_code\"<\/span> =&gt; <span class=\"hljs-string\">\"integer\"<\/span> }\n  }\n\n  date {\n    match  =&gt; &#91;<span class=\"hljs-string\">\"job_time\"<\/span>, <span class=\"hljs-string\">\"yyyy-MM-dd HH:mm:ss\"<\/span>]\n    target =&gt; <span class=\"hljs-string\">\"@timestamp\"<\/span>\n    remove_field =&gt; &#91;<span class=\"hljs-string\">\"job_time\"<\/span>]\n  }\n\n  <span class=\"hljs-keyword\">if<\/span> <span class=\"hljs-string\">\"_csvparsefailure\"<\/span> not in &#91;tags] {\n    mutate { remove_field =&gt; &#91;<span class=\"hljs-string\">\"message\"<\/span>] }\n  }\n}\n\noutput {\n  elasticsearch {\n    hosts =&gt; &#91;<span class=\"hljs-string\">\"https:\/\/localhost:9200\"<\/span>]\n    user =&gt; <span class=\"hljs-string\">\"elastic\"<\/span>\n    password =&gt; <span class=\"hljs-string\">\"${ES_PWD}\"<\/span>\n    ssl_certificate_authorities =&gt; &#91;<span class=\"hljs-string\">\"\/usr\/share\/logstash\/certs\/http_ca.crt\"<\/span>]\n    index =&gt; <span class=\"hljs-string\">\"batch-jobs-%{+YYYY.MM.dd}\"<\/span>\n  }\n  stdout { codec =&gt; rubydebug }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ul class=\"wp-block-list\">\n<li><code>date<\/code> replaces the ingestion time in <code>@timestamp<\/code> with the time the job actually ran, so Kibana time filters show the right results.<\/li>\n\n\n<li><code>${ES_PWD}<\/code> reads the password from an environment variable or the Logstash keystore, so it is never stored in plain text in the file.<\/li>\n\n\n<li>Elasticsearch 8.x enables TLS and authentication by default, which is why the URL uses <code>https<\/code> and supplies credentials. Older versions of the elasticsearch output plugin use <code>cacert<\/code> instead of <code>ssl_certificate_authorities<\/code>.<\/li>\n\n\n<li>The raw <code>message<\/code> is kept for lines that fail to parse, which makes debugging easier.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Running and testing the pipeline<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Check the syntax without starting the pipeline: <code>bin\/logstash -f batch.conf --config.test_and_exit<\/code>. A valid file prints <code>Configuration OK<\/code>.<\/li>\n\n\n<li>Run it in the foreground: <code>bin\/logstash -f batch.conf<\/code>. Add <code>--config.reload.automatic<\/code> to pick up edits without restarting.<\/li>\n\n\n<li>Watch the <code>rubydebug<\/code> output on the console to confirm the fields are parsed.<\/li>\n\n\n<li>Query Elasticsearch: <code>curl -u elastic --cacert http_ca.crt &quot;https:\/\/localhost:9200\/batch-jobs-*\/_search?size=1&amp;pretty&quot;<\/code>.<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">{\n     <span class=\"hljs-string\">\"@timestamp\"<\/span> =&gt; <span class=\"hljs-number\">2022<\/span><span class=\"hljs-number\">-03<\/span><span class=\"hljs-number\">-01<\/span>T10:<span class=\"hljs-number\">15<\/span>:<span class=\"hljs-number\">22.000<\/span>Z,\n         <span class=\"hljs-string\">\"status\"<\/span> =&gt; <span class=\"hljs-string\">\"SUCCESS\"<\/span>,\n           <span class=\"hljs-string\">\"date\"<\/span> =&gt; <span class=\"hljs-string\">\"2022-03-01\"<\/span>,\n           <span class=\"hljs-string\">\"time\"<\/span> =&gt; <span class=\"hljs-string\">\"10:15:22\"<\/span>,\n    <span class=\"hljs-string\">\"workstation\"<\/span> =&gt; <span class=\"hljs-string\">\"WS01\"<\/span>,\n    <span class=\"hljs-string\">\"application\"<\/span> =&gt; <span class=\"hljs-string\">\"Payroll\"<\/span>,\n            <span class=\"hljs-string\">\"job\"<\/span> =&gt; <span class=\"hljs-string\">\"JOB_123\"<\/span>,\n     <span class=\"hljs-string\">\"Error_code\"<\/span> =&gt; <span class=\"hljs-number\">0<\/span>,\n       <span class=\"hljs-string\">\"@version\"<\/span> =&gt; <span class=\"hljs-string\">\"1\"<\/span>\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Your output will also contain fields such as <code>host<\/code>, <code>log<\/code> and <code>event<\/code>, depending on the Logstash version and its ECS compatibility setting. The <code>date<\/code> filter reads times as UTC unless you set <code>timezone<\/code>, for example <code>timezone =&gt; &quot;Asia\/Kolkata&quot;<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Routing events with conditional outputs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The conditional output gist is pseudocode. <code>output for this type of message<\/code> is not valid syntax, and Logstash will refuse to start if it is left in. Replace each placeholder with a real output plugin. Use <code>else if<\/code> and <code>else<\/code> so that each event matches exactly one branch:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">output {\n  <span class=\"hljs-keyword\">if<\/span> <span class=\"hljs-string\">\"_csvparsefailure\"<\/span> in &#91;tags] {\n    file { path =&gt; <span class=\"hljs-string\">\"\/var\/log\/logstash\/failed-%{+YYYY.MM.dd}.log\"<\/span> }\n  } <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span> &#91;status] == <span class=\"hljs-string\">\"ERROR\"<\/span> {\n    elasticsearch {\n      hosts =&gt; &#91;<span class=\"hljs-string\">\"https:\/\/localhost:9200\"<\/span>]\n      user =&gt; <span class=\"hljs-string\">\"elastic\"<\/span>\n      password =&gt; <span class=\"hljs-string\">\"${ES_PWD}\"<\/span>\n      ssl_certificate_authorities =&gt; &#91;<span class=\"hljs-string\">\"\/usr\/share\/logstash\/certs\/http_ca.crt\"<\/span>]\n      index =&gt; <span class=\"hljs-string\">\"batch-errors-%{+YYYY.MM.dd}\"<\/span>\n    }\n  } <span class=\"hljs-keyword\">else<\/span> {\n    elasticsearch {\n      hosts =&gt; &#91;<span class=\"hljs-string\">\"https:\/\/localhost:9200\"<\/span>]\n      user =&gt; <span class=\"hljs-string\">\"elastic\"<\/span>\n      password =&gt; <span class=\"hljs-string\">\"${ES_PWD}\"<\/span>\n      ssl_certificate_authorities =&gt; &#91;<span class=\"hljs-string\">\"\/usr\/share\/logstash\/certs\/http_ca.crt\"<\/span>]\n      index =&gt; <span class=\"hljs-string\">\"batch-jobs-%{+YYYY.MM.dd}\"<\/span>\n    }\n  }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Conditionals support <code>==<\/code>, <code>!=<\/code>, <code>&lt;<\/code>, <code>&gt;<\/code>, regex matches with <code>=~<\/code>, membership with <code>in<\/code>, and <code>and<\/code>\/<code>or<\/code>\/<code>not<\/code>. Nested fields use the syntax <code>[log][level]<\/code>. The same conditionals also work inside the <code>filter<\/code> block.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common errors and fixes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Symptom<\/th><th>Likely cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td>Logstash starts but no events appear<\/td><td>The file was already recorded in sincedb, or <code>start_position<\/code> is missing<\/td><td>Set <code>start_position =&gt; &quot;beginning&quot;<\/code> and delete the sincedb file or point <code>sincedb_path<\/code> at <code>\/dev\/null<\/code><\/td><\/tr><tr><td><code>Expected one of [ \\t\\r\\n], &quot;#&quot;, ...<\/code> at startup<\/td><td>Syntax error, often leftover placeholder text or a missing brace<\/td><td>Run <code>--config.test_and_exit<\/code> and check the reported line and column<\/td><\/tr><tr><td>Events tagged <code>_csvparsefailure<\/code><\/td><td>Wrong separator, or quotes inside fields<\/td><td>Check <code>separator<\/code>, and set <code>quote_char<\/code> if needed<\/td><\/tr><tr><td>Events tagged <code>_dateparsefailure<\/code><\/td><td>The date pattern does not match the data<\/td><td>Compare the <code>match<\/code> pattern with a real value, including zero padding<\/td><\/tr><tr><td><code>401 Unauthorized<\/code> or SSL handshake errors<\/td><td>Elasticsearch 8.x security is enabled<\/td><td>Use <code>https<\/code>, valid credentials and the cluster CA certificate<\/td><\/tr><tr><td>File input reads nothing on Windows<\/td><td>Backslashes in <code>path<\/code><\/td><td>Use forward slashes, for example <code>C:\/logs\/*.log<\/code><\/td><\/tr><tr><td>Permission denied on input or output path<\/td><td>The Logstash service user cannot read or write the path<\/td><td>Fix ownership or permissions for the <code>logstash<\/code> user<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keep one pipeline per data source, defined in <code>pipelines.yml<\/code>, rather than one large file full of conditionals.<\/li>\n\n\n<li>Remove <code>sincedb_path =&gt; &quot;\/dev\/null&quot;<\/code> and the <code>stdout<\/code> output before going to production. Both are debugging aids.<\/li>\n\n\n<li>Store credentials in the Logstash keystore (<code>bin\/logstash-keystore add ES_PWD<\/code>) rather than in pipeline files.<\/li>\n\n\n<li>Use lowercase index names. Elasticsearch rejects index names that contain uppercase letters.<\/li>\n\n\n<li>Use date-based indices or Elasticsearch data streams with lifecycle policies so old data can be deleted automatically.<\/li>\n\n\n<li>Name fields consistently. A mix such as <code>Error_code<\/code> alongside lowercase fields makes Kibana queries harder.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Is a Logstash config file YAML?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Pipeline files use Logstash&#039;s own configuration syntax and normally have a <code>.conf<\/code> extension. Only the settings files <code>logstash.yml<\/code> and <code>pipelines.yml<\/code> are YAML.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does Logstash not read my existing log file?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By default the file input tails files, reading only new lines, and it records read positions in a sincedb file. Set <code>start_position =&gt; &quot;beginning&quot;<\/code> for new files, and clear the sincedb or set <code>sincedb_path<\/code> to <code>\/dev\/null<\/code> when you are testing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can one Logstash pipeline send data to multiple outputs?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Every plugin listed in the output block receives every event, unless you wrap the plugins in conditionals to route events by field values or tags.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is the filter section required in Logstash?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. A pipeline needs only an input and an output. Filters are optional and are used when events must be parsed, enriched or cleaned before output.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I test a Logstash configuration without running it?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run <code>bin\/logstash -f yourfile.conf --config.test_and_exit<\/code>. It parses the configuration and reports syntax errors without processing any events.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/what-is-elk-stack-and-use-cases-of-elk-stack\/\">What is ELK Stack and use cases of ELK Stack?<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/what-is-elasticsearch-and-use-cases-of-elasticsearch\/\">What is Elasticsearch and use cases of Elasticsearch?<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/top-50-logstash-interview-questions-and-answers\/\">Top 50 Logstash Interview Questions and Answers<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/monitoring-observability\/elastic\/\">More Elastic Stack (ELK) tutorials<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A Logstash pipeline has three stages: an input that reads events, optional filters that parse and enrich them, and one or more outputs that send them somewhere&#8230;. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5936],"tags":[987],"class_list":["post-31083","post","type-post","status-publish","format-standard","hentry","category-elastic","tag-logstash"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=31083"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31083\/revisions"}],"predecessor-version":[{"id":80611,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31083\/revisions\/80611"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=31083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=31083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=31083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}