# Translate filter is not working

**URL:** <https://discuss.elastic.co/t/translate-filter-is-not-working/379980>\
**Category:** Logstash\
**Created:** [July 10, 2025, 6:00am UTC](https://discuss.elastic.co/t/translate-filter-is-not-working/379980 "2025-07-10T06:00:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyanka\_chauhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyanka_chauhan/32/86146_2.png) [@Priyanka\_chauhan](https://discuss.elastic.co/u/Priyanka_chauhan)\
**Post date:** [July 10, 2025, 6:00am UTC](https://discuss.elastic.co/t/translate-filter-is-not-working/379980/1 "2025-07-10T06:00:38Z")

</div>

```auto
input {
  jdbc {
    jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/postgresql-42.7.3.jar"
    jdbc_driver_class => "org.postgresql.Driver"
    jdbc_connection_string => "jdbc:postgresql://db_ip:5432/cag"
    jdbc_user => "logstash"
    jdbc_password => "mypassword"
    schedule => "*/2 * * * *" # runs every minute
    statement => "SELECT * FROM auth_lists WHERE id > :sql_last_value"
    use_column_value => true
    tracking_column => "id"
    tracking_column_type => "numeric"
    last_run_metadata_path => "/var/lib/logstash/.logstash_jdbc_last_run"
    #statement => "SELECT * FROM auth_lists;"
  }
}

filter {
  translate {
    field => "device_ip_address"
    destination => "location"
    dictionary_path => "/usr/share/logstash/ip_location.yml"
    exact => true
    fallback => "unknown"
  }
}

output {
  elasticsearch {
     hosts => ["https://ec1:9200","https://ec2:9200"]
          ssl_certificate_authorities => '/etc/logstash/certs/http_ca.crt'
          user => "logstash_user"
          password => "mypassword"
          manage_template => false
          data_stream => false
          #index => "postgres-data"
          #index => "log-cag-db-%{+YYYY.MM.dd}"
          ilm_rollover_alias => "log-cag-db"
          ilm_pattern => "{now/d}-000001"
          ilm_enabled => "true"
          ilm_policy => "cag-db_policy"

  }
}

```

example of ip\_location.yml file:

"10.xx.xx.13": " CAG-New Delhi-New\_Building-2F"  
"10.xx.xx.14": " CAG-New Delhi-New\_Building-5F"  
"10.xx.xx.15": " CAG-New Delhi-New\_Building-3F"

why it is not working

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 10, 2025, 12:49pm UTC](https://discuss.elastic.co/t/translate-filter-is-not-working/379980/2 "2025-07-10T12:49:21Z")

</div>

> [@Priyanka\_chauhan](#):
>
> why it is not working

You will need to share the sample output of a document where you expected the translate filter to work, but it didnt, without it is not possible to troubleshoot.

---

<div class="post-metadata">

**Author:** ![Priyanka\_chauhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyanka_chauhan/32/86146_2.png) [@Priyanka\_chauhan](https://discuss.elastic.co/u/Priyanka_chauhan)\
**Post date:** [July 11, 2025, 6:30am UTC](https://discuss.elastic.co/t/translate-filter-is-not-working/379980/3 "2025-07-11T06:30:07Z")

</div>

```auto
{
  "_index": "log-cag-db-2025.06.19-000001",
  "_id": "uLEg-JcBLAcv2H4BYmXy",
  "_version": 1,
  "_score": 0,
  "_source": {
    "framed_ip_address": "10.47.180.148",
    "id": 118031,
    "device_ip_address": "10.47.171.230",
    "user_name": "shamsher.har.ae",
    "posture_status": "Compliant",
    "location": "",
    "status": 0,
    "endpoint_policy": "Windows10-Workstation",
    "remarks": "",
    "auth_acs_timestamp": "2025-07-11T10:13:25.926+05:30",
    "created_at": "2025-07-11T06:14:50.433459Z",
    "@timestamp": "2025-07-11T06:16:01.439047340Z",
    "@version": "1",
    "nas_port_id": "GigabitEthernet1/0/30",
    "calling_station_id": "8C:DC:D4:53:6C:10"
  },
  "fields": {
    "auth_acs_timestamp": [
      "2025-07-11T04:43:25.926Z"
    ],
    "device_ip_address.keyword": [
      "10.47.171.230"
    ],
    "user_name": [
      "shamsher.har.ae"
    ],
    "endpoint_policy": [
      "Windows10-Workstation"
    ],
    "created_at": [
      "2025-07-11T06:14:50.433Z"
    ],
    "framed_ip_address.keyword": [
      "10.47.180.148"
    ],
    "calling_station_id.keyword": [
      "8C:DC:D4:53:6C:10"
    ],
    "@version": [
      "1"
    ],
    "endpoint_policy.keyword": [
      "Windows10-Workstation"
    ],
    "id": [
      118031
    ],
    "nas_port_id.keyword": [
      "GigabitEthernet1/0/30"
    ],
    "framed_ip_address": [
      "10.47.180.148"
    ],
    "@version.keyword": [
      "1"
    ],
    "remarks.keyword": [
      ""
    ],
    "posture_status": [
      "Compliant"
    ],
    "user_name.keyword": [
      "shamsher.har.ae"
    ],
    "@timestamp": [
      "2025-07-11T06:16:01.439Z"
    ],
    "posture_status.keyword": [
      "Compliant"
    ],
    "location": [
      ""
    ],
    "device_ip_address": [
      "10.47.171.230"
    ],
    "nas_port_id": [
      "GigabitEthernet1/0/30"
    ],
    "calling_station_id": [
      "8C:DC:D4:53:6C:10"
    ],
    "location.keyword": [
      ""
    ],
    "remarks": [
      ""
    ],
    "status": [
      
    ]
  }
}

```

this is sample data coming from postgress database , now location field is empty here , I want to pick from either static location.yml file which is mapped with device ip address .or another way is pick location from antother table and show location in sample data with respect to device address.

---

<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:** [July 11, 2025, 11:47am UTC](https://discuss.elastic.co/t/translate-filter-is-not-working/379980/4 "2025-07-11T11:47:56Z")

</div>

Your translate filter has a fallback option, so that if the translation is applied the document will have either a value from the dictionary or the fallback value. Since your document has neither, it suggests the translation was not applied, which will happen if the field exists before the translate filter is called.

You can use the [override](https://www.elastic.co/docs/reference/logstash/plugins/plugins-filters-translate#plugins-filters-translate-override) option to force the target fields to be overwritten.
