# Logstash query for IPs and GeoData

**URL:** <https://discuss.elastic.co/t/logstash-query-for-ips-and-geodata/151689>\
**Category:** Logstash\
**Created:** [October 9, 2018, 5:11pm UTC](https://discuss.elastic.co/t/logstash-query-for-ips-and-geodata/151689 "2018-10-09T17:11:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blason](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blason/32/42284_2.png) [@Blason](https://discuss.elastic.co/u/Blason)\
**Post date:** [October 9, 2018, 5:11pm UTC](https://discuss.elastic.co/t/logstash-query-for-ips-and-geodata/151689/1 "2018-10-09T17:11:15Z")

</div>

Hi Team,

Here is my logstash config file and would like to know that how do I put a filter for IP addresses? \*.out can contain domains, URLs, IP addresses or hashes.

So as soon as logstash sees IP addresses geo data has to be created.  
Can someone please guide me?

```
input {

```

file {  
path =\> "/opt/output/\*.out"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter {  
csv {  
separator =\> ","  
columns =\> ["IOC","attack","Severity"]  
}  
}  
output {  
elasticsearch {  
hosts =\> "[http://172.xx.xx.xx:9200](http://172.xx.xx.xx:9200)"  
index =\> "logstash-iti-%{+YYYY.MM.dd}"  
}  
}

TIA  
Blason R

---

<div class="post-metadata">

**Author:** ![Blason](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blason/32/42284_2.png) [@Blason](https://discuss.elastic.co/u/Blason)\
**Post date:** [October 10, 2018, 3:44am UTC](https://discuss.elastic.co/t/logstash-query-for-ips-and-geodata/151689/2 "2018-10-10T03:44:35Z")

</div>

Hi Team,

It may sound basic but honetly I am not getting any clue here as to how to parse the and check for IOC column and if that contains IP need to add GEO data.

---

<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 7, 2018, 3:44am UTC](https://discuss.elastic.co/t/logstash-query-for-ips-and-geodata/151689/3 "2018-11-07T03:44:35Z")

</div>

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