# Unable to read the txt file through Logstash

**URL:** <https://discuss.elastic.co/t/unable-to-read-the-txt-file-through-logstash/251057>\
**Category:** Logstash\
**Created:** [October 5, 2020, 11:44pm UTC](https://discuss.elastic.co/t/unable-to-read-the-txt-file-through-logstash/251057 "2020-10-05T23:44:53Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)\
**Post date:** [October 7, 2020, 8:12pm UTC](https://discuss.elastic.co/t/unable-to-read-the-txt-file-through-logstash/251057/21 "2020-10-07T20:12:32Z")

</div>

Thanks Badger,  
but i put the same as you suggested but no luck.

filter {  
csv {  
separator =\> "|"  
columns =\> ["Time","Application","Message"]  
autodetect\_column\_names =\> true  
autogenerate\_column\_names =\> true  
}  
date { match =\> ["Time", "YYYY-MM-DD HH:mm:ss"] }  
#target =\> "Time"  
mutate {  
rename =\> ["Time", "Date"]  
}  
}

output:

[2020-10-07T16:10:14,868][INFO][logstash.outputs.elasticsearch][main] Attempting to install template {:manage\_template=\>{"index\_patterns"=\>"logstash-_", "version"=\>60001, "settings"=\>{"index.refresh\_interval"=\>"5s", "number\_of\_shards"=\>1}, "mappings"=\>{"dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date"}, "@version"=\>{"type"=\>"keyword"}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}  
[2020-10-07T16:10:14,897][INFO][logstash.javapipeline][main] Starting pipeline {:pipeline\_id=\>"main", "pipeline.workers"=\>8, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>50, "pipeline.max\_inflight"=\>1000, "pipeline.sources"=\>["C:/Users/skkoganti/Documents/Elastic/elastic\_download/logstash-7.9.1/logstash-7.9.1/config/edi\_development.conf"], :thread=\>"#\<Thread:0x18a36f92 run\>"}

---

<div class="post-metadata">

**Author:** ![llcarr\_work](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@llcarr\_work](https://discuss.elastic.co/u/llcarr_work)\
**Post date:** [October 7, 2020, 9:04pm UTC](https://discuss.elastic.co/t/unable-to-read-the-txt-file-through-logstash/251057/22 "2020-10-07T21:04:19Z")

</div>

when you use rename you need to use the =\> characters -  
rename =\> { "Time" =\> "Date" }

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 7, 2020, 10:47pm UTC](https://discuss.elastic.co/t/unable-to-read-the-txt-file-through-logstash/251057/23 "2020-10-07T22:47:50Z")

</div>

> [@sukumar.koganti](#):
>
> "YYYY-MM-DD HH:mm:ss"

Case matters. That should be "YYYY-MM-dd HH:mm:ss". dd is day of the month. DD is day of the year.

---

<div class="post-metadata">

**Author:** ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)\
**Post date:** [October 8, 2020, 1:31pm UTC](https://discuss.elastic.co/t/unable-to-read-the-txt-file-through-logstash/251057/24 "2020-10-08T13:31:16Z")

</div>

Yeah thanks Badger, it's working now.

how can i read only weekly wise files from the path based on date. which means i have files in the below path.

**\pneus.touchette\documents\EDI\Logs\Production**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/f/1f8d254ff1b3b7e7a9de7d3f5f8993d6e280df96.png)

how can i read .txt files based on latest date.

---

<div class="post-metadata">

**Author:** ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)\
**Post date:** [October 8, 2020, 6:55pm UTC](https://discuss.elastic.co/t/unable-to-read-the-txt-file-through-logstash/251057/25 "2020-10-08T18:55:20Z")

</div>

How to read only October files and tomorrow how my logstash will pic latest .txt file from the path.

**\pneus.touchette\documents\EDI\Logs\Production**

EDI Log-2020-10-08  
EDI Log-2020-10-07  
EDI Log-2020-10-06  
EDI Log-2020-10-05  
EDI Log-2020-10-04  
EDI Log-2020-10-03  
EDI Log-2020-10-02  
EDI Log-2020-10-01

input

{

file

{

path =\> ["[//pneus.touchette/documents/EDI/Logs/Production/EDI](https://pneus.touchette/documents/EDI/Logs/Production/EDI) Log-2020-10\*"]

start\_position =\> "beginning"

sincedb\_path =\> "NUL"

#ignore\_olderedit =\> 8000

}

}

---

<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 5, 2020, 6:55pm UTC](https://discuss.elastic.co/t/unable-to-read-the-txt-file-through-logstash/251057/26 "2020-11-05T18:55:31Z")

</div>

Closed on November 5, 2020, 6:55pm UTC

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

[Previous page](https://discuss.elastic.co/t/unable-to-read-the-txt-file-through-logstash/251057.md?page=1)
