# Read unstructured log file to extract certain values

**URL:** <https://discuss.elastic.co/t/read-unstructured-log-file-to-extract-certain-values/109253>\
**Category:** Logstash\
**Created:** [November 27, 2017, 5:03pm UTC](https://discuss.elastic.co/t/read-unstructured-log-file-to-extract-certain-values/109253 "2017-11-27T17:03:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![telebh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/telebh/32/42272_2.png) [@telebh](https://discuss.elastic.co/u/telebh)\
**Post date:** [November 27, 2017, 5:03pm UTC](https://discuss.elastic.co/t/read-unstructured-log-file-to-extract-certain-values/109253/1 "2017-11-27T17:03:59Z")

</div>

Hi there,

I am newbie to logstash... trying to use to parse our dataloding log files, extraction certain values from the file and store it into a JSON formated out file. for example: below is a snippet of the text log file, where "...." refers to some other info i am not interested in. in this snippet i need to capture the following: how can i do this?

1. "2" in 4th line which is # of records in xyz.zip file
2. "2" that number loaded to temp
3. "40" that number loaded to temp2

ignore all "...." text in between

/\*\*\*\* log file

No errors detected in compressed data of file/xyz.zip.  
file/xyz is a valid zip file.  
Total counts for this file is  
2  
....  
....  
2 records was loaded into the temp table  
40 records was loaded into the temp2 table

\*\*\*\*\*/

Thanks

---

<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:** [December 25, 2017, 5:04pm UTC](https://discuss.elastic.co/t/read-unstructured-log-file-to-extract-certain-values/109253/2 "2017-12-25T17:04:20Z")

</div>

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