# Parsing log file with logs of different patterns

**URL:** <https://discuss.elastic.co/t/parsing-log-file-with-logs-of-different-patterns/72933>\
**Category:** Logstash\
**Created:** [January 26, 2017, 5:45pm UTC](https://discuss.elastic.co/t/parsing-log-file-with-logs-of-different-patterns/72933 "2017-01-26T17:45:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prasad\_Zambare](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad_zambare/32/14946_2.png) [@Prasad\_Zambare](https://discuss.elastic.co/u/Prasad_Zambare)\
**Post date:** [January 26, 2017, 5:45pm UTC](https://discuss.elastic.co/t/parsing-log-file-with-logs-of-different-patterns/72933/1 "2017-01-26T17:45:11Z")

</div>

Hi All,

I am new to logstash in that matter ELK stack. A log file is having different processes logging data to it. Each process writes logs with different patterns. I want to parse this log file. Each log in this log file is started with below grok pattern,  
%{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:logsource} %{SYSLOGPROG}: + %{SRCFILE:srcfile}:%{NUMBER:linenumber}  
where SRCFILE is defined as [a-zA-Z0-9.\_-]+

Please let me know how can I parse this file so that different type of logs from each process logging in this file can be parsed.

Thank You,  
Prasad

---

<div class="post-metadata">

**Author:** ![kopacko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kopacko/32/10733_2.png) [@kopacko](https://discuss.elastic.co/u/kopacko)\
**Post date:** [January 27, 2017, 1:38am UTC](https://discuss.elastic.co/t/parsing-log-file-with-logs-of-different-patterns/72933/2 "2017-01-27T01:38:04Z")

</div>

You can build out fully configured patterns to match against or do partial matches based on IF statements.

---

<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:** [February 24, 2017, 1:38am UTC](https://discuss.elastic.co/t/parsing-log-file-with-logs-of-different-patterns/72933/3 "2017-02-24T01:38:04Z")

</div>

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