# Elasticsearch filter plugin is not working(logstash-filter-elasticsearch)

**URL:** <https://discuss.elastic.co/t/elasticsearch-filter-plugin-is-not-working-logstash-filter-elasticsearch/107586>\
**Category:** Elasticsearch\
**Created:** [November 14, 2017, 4:31pm UTC](https://discuss.elastic.co/t/elasticsearch-filter-plugin-is-not-working-logstash-filter-elasticsearch/107586 "2017-11-14T16:31:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dangal](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dangal](https://discuss.elastic.co/u/dangal)\
**Post date:** [November 14, 2017, 4:31pm UTC](https://discuss.elastic.co/t/elasticsearch-filter-plugin-is-not-working-logstash-filter-elasticsearch/107586/1 "2017-11-14T16:31:16Z")

</div>

Hi,  
here is my logstash conf and ss1.csv file has only passengerId field and the same field had in index titanic\_kfk\_shrink....so i would like that particular field in both the inputs (i mean input file and elasticsearch filter) and query the fields mentioned in fields option of elasticsearch filter

```auto
input {
 file {
   path => "/home/sgpl/logstash-5.4.0/config/ss1.csv"
   type => "end"
   sincedb_path => "/tmp/titanic"
    start_position => "beginning"
     }
     }
filter
{
  csv {
columns => ["PassengerId"]
separator => ","
 }

mutate {
 convert => { "PassengerId" => "integer" }
}
#if [type] == "end" {
elasticsearch {
            hosts => ["http://192.168.1.59:9233"]
           index => "titanic_kfk_shrink"
           #query => 'Age.keyword:%{Age.keyword}'
#query => "Pclass.keyword:1"
             query => 'PassengerId.keyword:"%{[PassengerId]}"'
             fields => ["Age.keyword","Gender.keyword"]

          # sort => "Age.keyword:desc"            
# }
#date {
# match => ["[started]", "ISO8601"]
# target => "[started]"
# }
}
}
#}
output {
    stdout { codec => rubydebug }
}

```

it is throwing error like  
[2017-11-14T20:55:14,898][WARN][logstash.filters.elasticsearch] Failed to query elasticsearch for previous event {:index=\>"titanic\_kfk\_shrink", :query=\>"PassengerId.keyword:"659"", :event=\>2017-11-14T15:25:13.855Z elasticsearch\_masternode 659, :error=\>#\<TypeError: can't convert nil into String\>}

please suggest what is wrong in my config file ASAP  
thanks in advance.

---

<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:** [December 12, 2017, 4:31pm UTC](https://discuss.elastic.co/t/elasticsearch-filter-plugin-is-not-working-logstash-filter-elasticsearch/107586/2 "2017-12-12T16:31:26Z")

</div>

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