# Drop message,but still write into elasticsearch

**URL:** <https://discuss.elastic.co/t/drop-message-but-still-write-into-elasticsearch/96614>\
**Category:** Logstash\
**Created:** [August 10, 2017, 12:49pm UTC](https://discuss.elastic.co/t/drop-message-but-still-write-into-elasticsearch/96614 "2017-08-10T12:49:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangheng](https://avatars.discourse-cdn.com/v4/letter/z/94ad74/32.png) [@zhangheng](https://discuss.elastic.co/u/zhangheng)\
**Post date:** [August 10, 2017, 12:49pm UTC](https://discuss.elastic.co/t/drop-message-but-still-write-into-elasticsearch/96614/1 "2017-08-10T12:49:58Z")

</div>

I was confused,because i drop some message in the filter,it really not out put in the stdout ,but it still write into the elasticsearch .  
here is my config, help me ,please

filter {  
if "GET" in [message] {  
drop { }  
}  
grok {  
match =\> ["message",'%{YEAR}[./-]%{MONTHNUM}[./-]%{MONTHDAY} %{TIME:request\_time} %{IP:client\_ip\_address} ["]%{WORD:method} %{URIPATHPARAM:request} HTTP/%{NUMBER:httpversion}["] (?\<status\_code\>%{NUMBER}|-) (?\<response\_lenth\>%{NUMBER}|-) (?\<total\_time\>%{NUMBER}|-) (?\<cu\_time\>%{NUMBER}|-) (?\<inside\_code\>%{NUMBER}|-) (?\<cu\_server\>%{IP}:%{NUMBER}|-) (?%{WORD}|-) (?%{WORD}|-) (?\<task\_config\>"._"|"-") (?\<sdk\_version\>[3-5]._|-)' ]  
}  
geoip {  
source =\> "client\_ip\_address"  
target =\> "geoip"  
database =\> "/xxxx/logstash-5.4.3/GeoLite2-City.mmdb"  
add\_field =\> ["[geoip][coordinates]", "%{[geoip][longitude]}" ]  
add\_field =\> ["[geoip][coordinates]", "%{[geoip][latitude]}" ]  
}  
mutate {  
convert =\> ["[geoip][coordinates]", "float"]  
}  
}  
output {  
elasticsearch {  
hosts =\> ["[http://xxxxxxx](http://xxxxxxx)"]  
index =\> "logstash-%{type}-%{+YYYY.MM.dd}"  
user =\> "xxxx"  
password =\> "xxxx"  
}  
stdout { codec =\> rubydebug }  
}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 10, 2017, 9:05pm UTC](https://discuss.elastic.co/t/drop-message-but-still-write-into-elasticsearch/96614/2 "2017-08-10T21:05:44Z")

</div>

Is it showing in `stdout` as well?

---

<div class="post-metadata">

**Author:** ![zhangheng](https://avatars.discourse-cdn.com/v4/letter/z/94ad74/32.png) [@zhangheng](https://discuss.elastic.co/u/zhangheng)\
**Post date:** [August 10, 2017, 10:51pm UTC](https://discuss.elastic.co/t/drop-message-but-still-write-into-elasticsearch/96614/3 "2017-08-10T22:51:39Z")

</div>

no,that is why i don't understand

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 11, 2017, 1:09am UTC](https://discuss.elastic.co/t/drop-message-but-still-write-into-elasticsearch/96614/4 "2017-08-11T01:09:06Z")

</div>

> [@zhangheng](#):
>
> geoip {
> 
> source =\> "client\_ip\_address"
> 
> target =\> "geoip"
> 
> database =\> "/xxxx/logstash-5.4.3/GeoLite2-City.mmdb"
> 
> add\_field =\> [“[geoip][coordinates]”, “%{[geoip][longitude]}” ]
> 
> add\_field =\> [“[geoip][coordinates]”, “%{[geoip][latitude]}” ]
> 
> }
> 
> mutate {
> 
> convert =\> [“[geoip][coordinates]”, “float”]
> 
> }
> 
> }

You can remove all that add\_field stuff and the convert, it's just noise that does nothing.

> [@zhangheng](#):
>
> no,that is why i don’t understand

What does one of the messages that doesn't get dropped look like?

---

<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:** [September 8, 2017, 1:09am UTC](https://discuss.elastic.co/t/drop-message-but-still-write-into-elasticsearch/96614/5 "2017-09-08T01:09:28Z")

</div>

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