# Configtest passes, but still get error on load

**URL:** <https://discuss.elastic.co/t/configtest-passes-but-still-get-error-on-load/54891>\
**Category:** Logstash\
**Created:** [July 7, 2016, 3:42am UTC](https://discuss.elastic.co/t/configtest-passes-but-still-get-error-on-load/54891 "2016-07-07T03:42:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![memelet](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@memelet](https://discuss.elastic.co/u/memelet)\
**Post date:** [July 7, 2016, 3:42am UTC](https://discuss.elastic.co/t/configtest-passes-but-still-get-error-on-load/54891/1 "2016-07-07T03:42:40Z")

</div>

I have a config with translate filter:

```
translate {
  field => "level"
  dictionary => [
    "DEBUG", "DEBUG"
    "INFO", "INFO"
    "WARN", "WARN"
    "ERR", "ERROR"
  ]
  fallback => "INFO"
  exact => true
}

```

The dictionary elements are not separated with commas. --configtest is happy with this, but logstash fails when it actually tries to load the config. Does this have something to do with thirdparty plugins?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 7, 2016, 5:38am UTC](https://discuss.elastic.co/t/configtest-passes-but-still-get-error-on-load/54891/2 "2016-07-07T05:38:25Z")

</div>

What's the error message? Which version of Logstash?

---

<div class="post-metadata">

**Author:** ![memelet](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@memelet](https://discuss.elastic.co/u/memelet)\
**Post date:** [July 7, 2016, 6:41am UTC](https://discuss.elastic.co/t/configtest-passes-but-still-get-error-on-load/54891/3 "2016-07-07T06:41:41Z")

</div>

logstash 2.3.3

Here's a simpler snippet, incorrect:

```
if ![level] {
  mutate { add_field { "level", "INFO" } }
}

```

passes configtest, but it should be

```
if ![level] {
  mutate { add_field => { "level" => "INFO" } }
}

```

However when actually running logstash I get error

```
Expected one of #, =>

```

Where the position is the beginning the filter {}, not anywhere near the actual error.

If this is not a known issue, or not easily reproducible, I can build a simple test case.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 7, 2016, 7:19am UTC](https://discuss.elastic.co/t/configtest-passes-but-still-get-error-on-load/54891/4 "2016-07-07T07:19:59Z")

</div>

Yeah, that look like a bug in the configuration file parser.

---

<div class="post-metadata">

**Author:** ![memelet](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@memelet](https://discuss.elastic.co/u/memelet)\
**Post date:** [July 12, 2016, 7:42am UTC](https://discuss.elastic.co/t/configtest-passes-but-still-get-error-on-load/54891/5 "2016-07-12T07:42:05Z")

</div>

Another example. I have this one config

```
input {
  file {
    path => "/var/log/audit/audit.log"
    type => "audit"
    add_field => {
      "service" => "audit",
      "name" => "audit"
    }
  }
}

```

$ service logstash restart  
Configuration error. Not restarting. Re-run with configtest parameter for details

$ sudo /opt/logstash/bin/logstash --configtest /etc/logstash/conf.d/00\_audit.conf  
Configuration 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:** [July 6, 2017, 4:48am UTC](https://discuss.elastic.co/t/configtest-passes-but-still-get-error-on-load/54891/6 "2017-07-06T04:48:30Z")

</div>


