# Logstash - translate issue

**URL:** <https://discuss.elastic.co/t/logstash-translate-issue/124749>\
**Category:** Logstash\
**Created:** [March 20, 2018, 11:41am UTC](https://discuss.elastic.co/t/logstash-translate-issue/124749 "2018-03-20T11:41:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pedro\_Cabral](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pedro_cabral/32/103308_2.png) [@Pedro\_Cabral](https://discuss.elastic.co/u/Pedro_Cabral)\
**Post date:** [March 20, 2018, 11:41am UTC](https://discuss.elastic.co/t/logstash-translate-issue/124749/1 "2018-03-20T11:41:02Z")

</div>

Hello all,

I have the following configuration:

```auto
    filter {
  if [type] == "bro-conn" {
    #The following makes use of the translate filter (logstash contrib) to convert conn_state into human text. Saves having to look up values for packet introspection
    translate {
      field => "conn_state"
        add_field => ["tags", "bro"]
      #destination => ["conn_state_full"]
      dictionary => [
        "S0", "Connection attempt seen, no reply",
        "S1", "Connection established, not terminated",
        "S2", "Connection established and close attempt by originator seen (but no reply from responder)",
        "S3", "Connection established and close attempt by responder seen (but no reply from originator)",
        "SF", "Normal SYN/FIN completion",
        "REJ", "Connection attempt rejected",
        "RSTO", "Connection established, originator aborted (sent a RST)",
        "RSTR", "Established, responder aborted",
        "RSTOS0", "Originator sent a SYN followed by a RST, we never saw a SYN-ACK from the responder",
        "RSTRH", "Responder sent a SYN ACK followed by a RST, we never saw a SYN from the (purported) originator",
        "SH", "Originator sent a SYN followed by a FIN, we never saw a SYN ACK from the responder (hence the connection was 'half' open)",
        "SHR", "Responder sent a SYN ACK followed by a FIN, we never saw a SYN from the originator",
        "OTH", "No SYN seen, just midstream traffic (a 'partial connection' that was not later closed)"
        ]
    }
  }
}
```

The output:

```auto
{
         "missed_bytes" => 0,
           "conn_state" => "S0",
           "@timestamp" => 2018-03-20T10:57:14.334Z,
                 "host" => "XXXX",
              "ip_dest" => 10,
              "ip_orig" => 10,
           "resp_bytes" => 0,
                "proto" => "udp",
    "senderbase_lookup" => "http://www.senderbase.org/lookup/?search_string=10.208.1.183",
         "resp_I2_addr" => "-",
     "ip_orig-resolved" => "10",
                   "ts" => 2018-03-20T10:48:20.426Z,
           "CBL_lookup" => "http://cbl.abuseat.org/lookup.cgi?ip=10.208.1.183",
               "offset" => 2827607,
              "message" => "conn\tsensor001-001\tbro\t1521542900.426871\tCRcVWN3LO7Sk3dLSO4\t10.208.1.183\t54752\t10.208.3.255\t137\tudp\tdns\t-\t-\t-\tS0\tT\tT\t0\tD\t1\t78\t0\t0\t(empty)\t-\t-\t-\t-\t0\t0\t-\t-",
       "tunnel_parents" => "(empty)",
           "local_orig" => "T",
              "history" => "D",
             "@version" => "1",
                 "tags" => [
        [0] "beats_input_codec_plain_applied",
        [1] "bro"
    ],
            "port_orig" => 54752,
              "service" => "dns",
            "port_dest" => 137,
        "orig_ip_bytes" => 78,
            "resp_pkts" => 0,
     "ip_dest-resolved" => "10",
                 "proc" => "bro",
                 "beat" => {
         "version" => "6.2.2",
        "hostname" => "XXXX",
            "name" => "XXXX"
    },
                 "type" => [
        [0] "bro-conn",
        [1] "conn"
    ],
               "source" => "/data/logs/current/conn.log",
               "sensor" => "sensor001-001",
                  "uid" => "CRcVWN3LO7Sk3dLSO4",
            "orig_pkts" => 1,
                 "vlan" => 0,
        "resp_ip_bytes" => 0,
           "orig_bytes" => 0,
         "orig_I2_addr" => "-",
           "inner_vlan" => 0,
      "Spamhaus_lookup" => "http://www.spamhaus.org/query/bl?ip=10.208.1.183",
             "duration" => "-",
           "local_resp" => "T"
}
```

I can't understand why I can't trigger the translate.  
Already added "exact" =\> true & "regex" =\> true but still the same problem.  
Thanks in advance for your help.

Pedro Cabral

---

<div class="post-metadata">

**Author:** ![Pedro\_Cabral](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pedro_cabral/32/103308_2.png) [@Pedro\_Cabral](https://discuss.elastic.co/u/Pedro_Cabral)\
**Post date:** [March 22, 2018, 9:32am UTC](https://discuss.elastic.co/t/logstash-translate-issue/124749/2 "2018-03-22T09:32:31Z")

</div>

anyone?

---

<div class="post-metadata">

**Author:** ![paz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paz/32/28003_2.png) [@paz](https://discuss.elastic.co/u/paz)\
**Post date:** [March 22, 2018, 11:25am UTC](https://discuss.elastic.co/t/logstash-translate-issue/124749/3 "2018-03-22T11:25:50Z")

</div>

The output indicates there is probably an issue with your earlier filtering process. Specifically this part :

```auto
"type" => [
        [0] "bro-conn",
        [1] "conn"
    ],
```

As you can see, you have two types in your event, making the field an array, which in turn causes your initial translate condition to fail.

Also, generally you'd want to supply a destination field in your translate config.

---

<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:** [April 19, 2018, 11:26am UTC](https://discuss.elastic.co/t/logstash-translate-issue/124749/4 "2018-04-19T11:26:26Z")

</div>

Closed on April 19, 2018, 11:26am UTC

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