# Index .txt format log file

**URL:** <https://discuss.elastic.co/t/index-txt-format-log-file/46338>\
**Category:** Logstash\
**Created:** [April 5, 2016, 7:30am UTC](https://discuss.elastic.co/t/index-txt-format-log-file/46338 "2016-04-05T07:30:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prateek\_Kshtriya](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prateek\_Kshtriya](https://discuss.elastic.co/u/Prateek_Kshtriya)\
**Post date:** [April 5, 2016, 7:30am UTC](https://discuss.elastic.co/t/index-txt-format-log-file/46338/1 "2016-04-05T07:30:17Z")

</div>

Hi All,

Please suggest how to create a config file to index .txt format log file.

Tried to index simply by adding path in the config with output to elasticsearch.  
The data in the log(.txt) comes like below-  
02 00 10:15:13 PM Batch job SAMPLEBATCH  
00 00 10:15:14 PM Exporter definition (SAMPLEBATCH) has been loaded  
00 00 10:15:15 PM Press the cancel button to interrupt the extraction.  
00 00 10:15:15 PM Initiating the data extract...  
00 00 10:15:15 PM Starting extraction setup 'SAMPLEBATCH'  
99 00 10:15:15 PM Gathering information about the extraction process...  
99 00 10:15:16 PM Initializing data source...  
99 00 10:15:16 PM 0 records processed [reading records]...  
99 00 10:15:17 PM 0 records processed [calculating 0 records]...  
99 00 10:15:17 PM 0 records processed [writing 0 records]...  
99 00 10:15:18 PM 0 records were processed [finishing]...  
99 00 10:15:18 PM Finishing...  
00 00 10:15:18 PM The extraction 'SAMPLEBATCH' is complete.  
00 00 10:15:18 PM Status: Finished  
00 00 10:15:18 PM Start: 29/03/2016 10:15:15 PM  
00 00 10:15:18 PM Stop: 29/03/2016 10:15:18 PM  
00 00 10:15:18 PM Records extracted: 0  
00 00 10:15:18 PM Records applied: 0  
00 00 10:15:18 PM There is no data to export.  
03 00 10:15:18 PM Batch job SAMPLEBATCH

So please suggest how shall I proceed.

Regards,  
Prateek  
Please suggest

---

<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:** [April 7, 2016, 1:09am UTC](https://discuss.elastic.co/t/index-txt-format-log-file/46338/2 "2016-04-07T01:09:14Z")

</div>

You should start by creating a grok pattern to match things.  
You can use [http://grokdebug.herokuapp.com/](http://grokdebug.herokuapp.com/) for that

---

<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:** [July 6, 2017, 5:03am UTC](https://discuss.elastic.co/t/index-txt-format-log-file/46338/3 "2017-07-06T05:03:25Z")

</div>


