# LogStash::ConfigurationError", :message=\>"Expected one of \[ \\\\t\\\\r\\\\n\], \\"#\\", \\"if\\", \[A-Za-z0-9\_-\], '\\"', \\"'\\", \\"}\\"

**URL:** https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402
**Category:** Logstash
**Created:** [August 18, 2022, 6:26pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402 "2022-08-18T18:26:07Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Queren\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/queren_santos/32/109847_2.png) [@Queren\_Santos](https://discuss.elastic.co/u/Queren_Santos)
#### Post date: [August 18, 2022, 6:26pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/1 "2022-08-18T18:26:07Z")

</div>

I'm having trouble understanding my code configuration error. Shows the following message when trying to run the logs and their settings:

[ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::ConfigurationError", :message=\>"Expected one of [\t\r\n], "#", "if", [A-Za-z0-9\_-], '"', "'", "}" at line 3, column 1 (byte 10) after input {\n\n", :backtrace=\>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:199:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:72:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:48:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline\_action/create.rb:50:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:381:in `block in converge\_state'"]}

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [August 18, 2022, 6:29pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/2 "2022-08-18T18:29:28Z")

</div>

What does your configuration look like? The compiler is objecting to whatever comes after

```
input {

```

So tell us what comes after that.

---

<div class="post-metadata">

### Author: ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)
#### Post date: [August 19, 2022, 9:35am UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/3 "2022-08-19T09:35:40Z")

</div>

Please paste (with \</\> tag) your logstash.yml and files from conf.d/\*.yml.

---

<div class="post-metadata">

### Author: ![Queren\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/queren_santos/32/109847_2.png) [@Queren\_Santos](https://discuss.elastic.co/u/Queren_Santos)
#### Post date: [August 22, 2022, 8:03pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/4 "2022-08-22T20:03:48Z")

</div>

input {  
file {  
path =\> "/tmp/spreadsheet\_data.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "NULL"  
}  
}  
filter {  
csv {  
separator =\> ","  
columns =\> ["Name","Class","Dorm","Room","GPA"]  
}  
}  
output {  
elasticsearch {  
hosts =\>"[http://localhost:9200](http://localhost:9200)"  
index =\>"spreadsheet\_data"  
}  
}

---

<div class="post-metadata">

### Author: ![Queren\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/queren_santos/32/109847_2.png) [@Queren\_Santos](https://discuss.elastic.co/u/Queren_Santos)
#### Post date: [August 22, 2022, 8:05pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/5 "2022-08-22T20:05:52Z")

</div>

What would the syntax look like?

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [August 22, 2022, 8:12pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/6 "2022-08-22T20:12:37Z")

</div>

> [@Queren\_Santos](#):
>
> sincedb\_path =\> "NULL"

That will create a file called NULL in logstash's working directory. If you do not want the in-memory sincedb persisted across restarts then use `sincedb_path => "/dev/null"`.

---

<div class="post-metadata">

### Author: ![Queren\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/queren_santos/32/109847_2.png) [@Queren\_Santos](https://discuss.elastic.co/u/Queren_Santos)
#### Post date: [August 23, 2022, 2:41pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/7 "2022-08-23T14:41:35Z")

</div>

Thanks for the suggestion, but unfortunately it didn't work. The filter is basic with csv to json conversion, I want to analyze this data in Grafana. It shows an error message in the output part of the code, do you have any idea how the syntax of this part would be?

Error message:

[FATAL] 2022-08-23 11:36:28.419 [LogStash::Runner] runner - The given configuration is invalid. Reason: Expected one of [A-Za-z0-9\_-], [\t\r\n], "#", "{" at line 19, column 17 (byte 356) after output {  
output

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [August 23, 2022, 2:43pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/8 "2022-08-23T14:43:29Z")

</div>

Again, that would entirely depend on what comes after the text in the error message.

---

<div class="post-metadata">

### Author: ![Queren\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/queren_santos/32/109847_2.png) [@Queren\_Santos](https://discuss.elastic.co/u/Queren_Santos)
#### Post date: [August 23, 2022, 2:47pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/9 "2022-08-23T14:47:34Z")

</div>

This is the error

- Ignoring the 'pipelines.yml' file because modules or command line options are specified

---

<div class="post-metadata">

### Author: ![Queren\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/queren_santos/32/109847_2.png) [@Queren\_Santos](https://discuss.elastic.co/u/Queren_Santos)
#### Post date: [August 23, 2022, 2:49pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/10 "2022-08-23T14:49:07Z")

</div>

File pipeline.yml

# This file is where you define your pipelines. You can define multiple.

# For more information on multiple pipelines, see the documentation:

# [Multiple Pipelines | Logstash](https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html)

- pipeline.id: main

# path.config: "/etc/logstash/conf.d/\*.conf"

path.config: "/etc/logstash/\*.config"

---

<div class="post-metadata">

### Author: ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)
#### Post date: [August 23, 2022, 2:49pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/11 "2022-08-23T14:49:54Z")

</div>

> [@Queren\_Santos](#):
>
> input {  
> file {  
> path =\> "/tmp/spreadsheet\_data.csv"  
> start\_position =\> "beginning"  
> sincedb\_path =\> "NULL"  
> }  
> }  
> filter {  
> csv {  
> separator =\> ","  
> columns =\> ["Name","Class","Dorm","Room","GPA"]  
> }  
> }  
> output {  
> elasticsearch {  
> hosts =\>"[http://localhost:9200](http://localhost:9200)"  
> index =\>"spreadsheet\_data"  
> }  
> }

First thing - please remember that YAML uses spaces. Please change this:

> [@Queren\_Santos](#):
>
> hosts =\>"[http://localhost:9200](http://localhost:9200)"  
> index =\>"spreadsheet\_data"

into this:

```auto
hosts => "http://localhost:9200"
index => "spreadsheet_data"

```

---

<div class="post-metadata">

### Author: ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)
#### Post date: [August 24, 2022, 12:41pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/12 "2022-08-24T12:41:38Z")

</div>

> [@Queren\_Santos](#):
>
> Ignoring the 'pipelines.yml' file because modules or command line options are specified

This message says that you should disable whole this section:

```auto
# ------------ Pipeline Settings --------------
#
# The ID of the pipeline.
#
#pipeline.id: main
#
# Set the number of workers that will, in parallel, execute the filters+outputs
# stage of the pipeline.
#
# This defaults to the number of the host's CPU cores.
#
#pipeline.workers: 2
#
# How many events to retrieve from inputs before sending to filters+workers
#
#pipeline.batch.size: 125
#
# How long to wait in milliseconds while polling for the next event
# before dispatching an undersized batch to filters+outputs
#
#pipeline.batch.delay: 50
#
# Force Logstash to exit during shutdown even if there are still inflight
# events in memory. By default, logstash will refuse to quit until all
# received events have been pushed to the outputs.
#
# WARNING: enabling this can lead to data loss during shutdown
#
# pipeline.unsafe_shutdown: false
#
# Set the pipeline event ordering. Options are "auto" (the default), "true" or "false".
# "auto" will automatically enable ordering if the 'pipeline.workers' setting
# is also set to '1'.
# "true" will enforce ordering on the pipeline and prevent logstash from starting
# if there are multiple workers.
# "false" will disable any extra processing necessary for preserving ordering.
#
#pipeline.ordered: auto
#
# Sets the pipeline's default value for `ecs_compatibility`, a setting that is
# available to plugins that implement an ECS Compatibility mode for use with
# the Elastic Common Schema.
# Possible values are:
# - disabled (default)
# - v1
# - v8
# The default value will be `v8` in Logstash 8, making ECS on-by-default. To ensure a
# migrated pipeline continues to operate as it did before your upgrade, opt-OUT
# of ECS for the individual pipeline in its `pipelines.yml` definition. Setting
# it here will set the default for _all_ pipelines, including new ones.
#
# pipeline.ecs_compatibility: disabled

```

Than in section `Pipeline Configuration Settings` you should enable this setting:

```auto
path.config: "/etc/logstash/conf.d/*.conf"

```

and after that you can adjust other settings in this section. Please remember that your conf file should be located in `/etc/logstash/conf.d/` directory. You can use more than one conf file and have more that one input/output setting.

---

<div class="post-metadata">

### Author: ![Queren\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/queren_santos/32/109847_2.png) [@Queren\_Santos](https://discuss.elastic.co/u/Queren_Santos)
#### Post date: [August 24, 2022, 3:33pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/13 "2022-08-24T15:33:18Z")

</div>

Thanks, that really was it, setup ok

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 21, 2022, 3:33pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-message-expected-one-of-t-r-n-if-a-za-z0-9/312402/14 "2022-09-21T15:33:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
