# Translate filter not mapping output

**URL:** <https://discuss.elastic.co/t/translate-filter-not-mapping-output/177277>\
**Category:** Logstash\
**Created:** [April 17, 2019, 10:59am UTC](https://discuss.elastic.co/t/translate-filter-not-mapping-output/177277 "2019-04-17T10:59:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![msk\_76](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@msk\_76](https://discuss.elastic.co/u/msk_76)\
**Post date:** [April 17, 2019, 10:59am UTC](https://discuss.elastic.co/t/translate-filter-not-mapping-output/177277/1 "2019-04-17T10:59:36Z")

</div>

**I have following test.conf file of logstash**

input {  
stdin {  
codec =\> json  
}  
}

filter {  
translate {  
field =\> "user"  
destination =\> "division"  
dictionary\_path =\> './PA\_orga1\_div.yml'

# add\_field =\> ["div", "%{division}"]

```
            }

    }

```

output {  
stdout {  
codec =\> plain {  
charset =\> "ISO-8859-1"  
}  
}  
}

**The contents of PA\_orga1\_div.yml are**  
"sylvain" : "TRD\_MEMS"  
"arnaud" : "TRD\_LAB"

**On running the logstash with given configuration, I am not getting the "division" field in output corresponding to "sylvain"**

../bin/logstash -f test.conf  
Sending Logstash logs to /ELK/sw/logstash-6.4.2/logs which is now configured via log4j2.properties  
[2019-04-17T16:24:46,451][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2019-04-17T16:24:46,987][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"6.4.2"}  
[2019-04-17T16:24:49,091][INFO][logstash.pipeline] Starting pipeline {:pipeline\_id=\>"main", "pipeline.workers"=\>10, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>50}  
[2019-04-17T16:24:49,337][INFO][logstash.inputs.stdin] Automatically switching from json to json\_lines codec {:plugin=\>"stdin"}  
[2019-04-17T16:24:49,408][INFO][logstash.pipeline] Pipeline started successfully {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x29e58b57 run\>"}  
The stdin plugin is now waiting for input:  
[2019-04-17T16:24:49,492][INFO][logstash.agent] Pipelines running {:count=\>1, :running\_pipelines=\>[:main], :non\_running\_pipelines=\>}  
[2019-04-17T16:24:49,841][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}

{ "user" : "sylvain" }  
2019-04-17T10:55:09.305Z dlhl2117 %{message}

---

<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:** [April 17, 2019, 12:30pm UTC](https://discuss.elastic.co/t/translate-filter-not-mapping-output/177277/2 "2019-04-17T12:30:35Z")

</div>

That's working as expected. With a json\_lines codec on the input (json gets replaced automatically with json\_lines) there is no message field. And the default format for a plain output codec is to print the hostname followed by the message field.

If you replaced the plain codec with rubydebug you would see

```
{
  "division" => "TRD_MEMS",
      "user" => "sylvain",
[...]
       "div" => "TRD_MEMS",
"@timestamp" => 2019-04-17T12:29:38.648Z,
  "@version" => "1"
}
```

---

<div class="post-metadata">

**Author:** ![msk\_76](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@msk\_76](https://discuss.elastic.co/u/msk_76)\
**Post date:** [April 17, 2019, 12:56pm UTC](https://discuss.elastic.co/t/translate-filter-not-mapping-output/177277/3 "2019-04-17T12:56:13Z")

</div>

Thanks. It worked after changing output codec.

---

<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:** [May 15, 2019, 1:02pm UTC](https://discuss.elastic.co/t/translate-filter-not-mapping-output/177277/4 "2019-05-15T13:02:11Z")

</div>

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