# Error When loading Logstash

**URL:** <https://discuss.elastic.co/t/error-when-loading-logstash/115639>\
**Category:** Logstash\
**Created:** [January 16, 2018, 6:13am UTC](https://discuss.elastic.co/t/error-when-loading-logstash/115639 "2018-01-16T06:13:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Methsri\_Wickramarath](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@Methsri\_Wickramarath](https://discuss.elastic.co/u/Methsri_Wickramarath)\
**Post date:** [January 16, 2018, 6:13am UTC](https://discuss.elastic.co/t/error-when-loading-logstash/115639/1 "2018-01-16T06:13:19Z")

</div>

Hi All,  
Am getting the following error with Logstash

> Blockquote  
> [2018-01-16T11:32:17,216][ERROR][logstash.agent] Cannot load an invalid configuration {:reason=\>"Expected one of #, input, filter, output at line 75, column 1 (byte 1274) after "}  
> [2018-01-16T11:33:13,338][ERROR][logstash.agent] Cannot load an invalid configuration {:reason=\>"Expected one of #, input, filter, output at line 75, column 1 (byte 1274) after "}  
> [2018-01-16T11:34:37,748][ERROR][logstash.agent] Cannot load an invalid configuration {:reason=\>"Expected one of #, input, filter, output at line 75, column 1 (byte 1274) after "}  
> [2018-01-16T11:35:41,704][ERROR][logstash.agent] Cannot load an invalid configuration {:reason=\>"Expected one of #, input, filter, output at line 75, column 1 (byte 1274) after "}  
> [2018-01-16T11:36:43,606][ERROR][logstash.agent] Cannot load an invalid configuration {:reason=\>"Expected one of #, input, filter, output at line 75, column 1 (byte 1274) after "}  
> [2018-01-16T11:38:09,067][ERROR][logstash.agent] Cannot load an invalid configuration {:reason=\>"Expected one of #, input, filter, output at line 75, column 1 (byte 1274) after "}

Following is my Logstash config file.

> Blockquote  
> input {  
> udp {  
> port =\> 12345  
> codec =\> netflow {  
> versions =\> [5,9,10]  
> }  
> type =\> netflow  
> }  
> udp {  
> port =\> 4739  
> codec =\> netflow {  
> versions =\> [10]  
> target =\> ipfix  
> }  
> type =\> ipfix  
> }  
> tcp {  
> port =\> 4739  
> codec =\> netflow {  
> versions =\> [10]  
> target =\> ipfix  
> }  
> type =\> ipfix  
> }  
> }  
> filter {  
> translate {  
> field =\> "host"  
> destination =\> "hostname"  
> dictionary =\> ["203.143.1.85", "Dialog", "203.143.4.1", "LISPAIX", "203.143.1.82", "Airtel", "203.143.1.22", "SLT"]  
> }  
> translate {  
> field =\> "[netflow][l4\_dst\_port]"  
> destination =\> "app\_cat"  
> dictionary\_path =\> "/etc/logstash/app\_category.yml" }  
> translate {  
> field =\> "[netflow][l4\_src\_port]"  
> destination =\> "app\_cat"  
> dictionary\_path =\> "/etc/logstash/app\_category.yml" }  
> translate {  
> field =\> "[netflow][ipv4\_dst\_addr]"  
> destination =\> "app\_cat"  
> dictionary\_path =\> "/etc/logstash/appips.yml"  
> override =\> "true" }  
> translate {  
> field =\> "[netflow][ipv4\_src\_addr]"  
> destination =\> "app\_cat"  
> dictionary\_path =\> "/etc/logstash/appips.yml"  
> override =\> "true"  
> }  
> }  
> output {  
> elasticsearch { hosts =\> ["127.0.0.1:9200"] }  
> }

---

<div class="post-metadata">

**Author:** ![Mojster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mojster/32/21209_2.png) [@Mojster](https://discuss.elastic.co/u/Mojster)\
**Post date:** [January 16, 2018, 7:58am UTC](https://discuss.elastic.co/t/error-when-loading-logstash/115639/2 "2018-01-16T07:58:13Z")

</div>

Remove first line or comment it with #:

```auto
#Blockquote

```

---

<div class="post-metadata">

**Author:** ![Methsri\_Wickramarath](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@Methsri\_Wickramarath](https://discuss.elastic.co/u/Methsri_Wickramarath)\
**Post date:** [January 16, 2018, 8:41am UTC](https://discuss.elastic.co/t/error-when-loading-logstash/115639/3 "2018-01-16T08:41:20Z")

</div>

Thanks for the reply!!!

Can you please specify exactly which line I have to comment......

---

<div class="post-metadata">

**Author:** ![Mojster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mojster/32/21209_2.png) [@Mojster](https://discuss.elastic.co/u/Mojster)\
**Post date:** [January 16, 2018, 8:50am UTC](https://discuss.elastic.co/t/error-when-loading-logstash/115639/4 "2018-01-16T08:50:30Z")

</div>

The first line.

It's stated Blockqute, but's in default config it has a # before that.  
I've comment it in my previous post, as an example.

---

<div class="post-metadata">

**Author:** ![Methsri\_Wickramarath](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@Methsri\_Wickramarath](https://discuss.elastic.co/u/Methsri_Wickramarath)\
**Post date:** [January 16, 2018, 9:01am UTC](https://discuss.elastic.co/t/error-when-loading-logstash/115639/5 "2018-01-16T09:01:05Z")

</div>

Ahh!!!!  
That's the line added from this reply box when I used the BlockQuote like below.

> Blockquote

---

<div class="post-metadata">

**Author:** ![Mojster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mojster/32/21209_2.png) [@Mojster](https://discuss.elastic.co/u/Mojster)\
**Post date:** [January 16, 2018, 9:38am UTC](https://discuss.elastic.co/t/error-when-loading-logstash/115639/6 "2018-01-16T09:38:00Z")

</div>

I've tried to run it on my test environment, but I get refused because I don't have dictionary files.

Try to removing/commenting items/filters/rows, until you get a working one and continue from there.

---

<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:** [February 13, 2018, 9:38am UTC](https://discuss.elastic.co/t/error-when-loading-logstash/115639/7 "2018-02-13T09:38:26Z")

</div>

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