# Logstash v6.2.2 - Elasticsearch plugin Query - Duplicate Data

**URL:** <https://discuss.elastic.co/t/logstash-v6-2-2-elasticsearch-plugin-query-duplicate-data/151604>\
**Category:** Logstash\
**Created:** [October 9, 2018, 10:01am UTC](https://discuss.elastic.co/t/logstash-v6-2-2-elasticsearch-plugin-query-duplicate-data/151604 "2018-10-09T10:01:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martb/32/78185_2.png) [@martb](https://discuss.elastic.co/u/martb)\
**Post date:** [October 9, 2018, 10:01am UTC](https://discuss.elastic.co/t/logstash-v6-2-2-elasticsearch-plugin-query-duplicate-data/151604/1 "2018-10-09T10:01:10Z")

</div>

Hi,

I have two indexes, malware-\*(contains a list of malware threats) and xxxx-main-controls, when the xxxx-2-3.conf (see below) runs it queries the malware index for a match to the urlpath field and if matched adds threat\_category and url\_link fields to the corresponding record in index xxxx-main-controls.

The first part works as expected, however it also dumps all the matched fields and data from the input JDBC to the malware-\* index when this is supposed to be the lookup only index. I'm new to using the elasticsearch plugin filter so any help would be much appreciated.

xxxx-2-3.conf:

input {  
jdbc connection multiple fields...........

filter {  
if [type] == "xxxx-2-3" {  
mutate {  
convert =\> { "eventtime" =\> "string" }  
add\_field =\> {"xxxxtype" =\> "%{type}" }  
}  
date {  
match =\> ["eventtime", "ISO8601"]  
remove\_field =\> ["eventtime"]  
}  
elasticsearch {  
hosts =\> "[http://xxx.xxx.xxx.xxx:9200](http://xxx.xxx.xxx.xxx:9200)"  
index =\> "malware-\*"  
query =\> 'url:"%{[urlpath]}"'  
fields =\> { "threat" =\> "threat\_category" }  
fields =\> { "urlhaus\_link" =\> "url\_link" }  
}  
}  
}  
output {  
if [type] == "xxxx-2-3" {  
elasticsearch {  
hosts =\> "[http://xxx.xxx.xxx.xxx:9200](http://xxx.xxx.xxx.xxx:9200)"  
user =\> "ELASTIC\_USER"  
password =\> "ELASTIC\_PWD"  
index =\> "xxxx-main-controls-%{+YYYY.MM.dd}"  
}  
}  
}

---

<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:** [November 6, 2018, 10:01am UTC](https://discuss.elastic.co/t/logstash-v6-2-2-elasticsearch-plugin-query-duplicate-data/151604/2 "2018-11-06T10:01:13Z")

</div>

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