# Filter text file use logstash

**URL:** <https://discuss.elastic.co/t/filter-text-file-use-logstash/220427>\
**Category:** Logstash\
**Created:** [February 21, 2020, 5:36pm UTC](https://discuss.elastic.co/t/filter-text-file-use-logstash/220427 "2020-02-21T17:36:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Achmad\_Arifin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/achmad_arifin/32/47708_2.png) [@Achmad\_Arifin](https://discuss.elastic.co/u/Achmad_Arifin)\
**Post date:** [February 21, 2020, 5:36pm UTC](https://discuss.elastic.co/t/filter-text-file-use-logstash/220427/1 "2020-02-21T17:36:47Z")

</div>

how do I display in the logstash all the contents in a .txt file?  
this is the screenshot of my txt  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/f/2f267ebd20b8a510f5d5019fd956902f921636fd.png)

and this is my logstash config

input {  
file {  
#type =\> "doc"  
#path =\> "/home/wsagiva/Desktop/logs/log.txt"  
path =\> "/home/ip.txt"  
start\_position =\> "beginning"  
#codec =\> "doc"  
sincedb\_path =\> "/dev/null"  
#type =\> ""  
}  
}

filter {  
grok {  
match =\> ["message", "%{COMBINEDAPACHELOG}"]  
}  
}

output {  
elasticsearch {  
hosts =\> ["192.168.1.201:9200"]  
# index =\> "ip"  
}  
stdout {  
codec =\> "rubydebug"  
}  
}

i want to add the ip address from txt file to field of logstash, and i want to visualize it.

---

<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:** [March 20, 2020, 5:36pm UTC](https://discuss.elastic.co/t/filter-text-file-use-logstash/220427/2 "2020-03-20T17:36:50Z")

</div>

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