# Classifying different events using logstash

**URL:** <https://discuss.elastic.co/t/classifying-different-events-using-logstash/231229>\
**Category:** Logstash\
**Created:** [May 5, 2020, 9:55pm UTC](https://discuss.elastic.co/t/classifying-different-events-using-logstash/231229 "2020-05-05T21:55:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ram\_Jeghan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_jeghan/32/48128_2.png) [@Ram\_Jeghan](https://discuss.elastic.co/u/Ram_Jeghan)\
**Post date:** [May 5, 2020, 9:55pm UTC](https://discuss.elastic.co/t/classifying-different-events-using-logstash/231229/1 "2020-05-05T21:55:50Z")

</div>

Hi,

We have log events from different sources:

- windows
- syslog
- firewall  
-database  
etc

dumped into the same file from a legacy process.

event1 could be windows, event2 could be oracle etc.,

What would be the best way to classify and seperate different types of log events.

I attempted using logstash groks based on presence of specific elements in the events to route the events to different folders.

For example, ORACLE logs have ORA in the message

```auto
filter {
    grok {
        match => { "[log][file][path]" => "/tmp/log/%{WORD:type}/%{DATA}" }
    }
}

output{
      file {
        path => "/tmp/target/%{type}/%{+yyyy.MM.dd.HH}/log.out"
     }
}

```

The above will not cover all the scenarios.

Is there a cleaner approach to perform the same.

Thank you

---

<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:** [June 2, 2020, 9:55pm UTC](https://discuss.elastic.co/t/classifying-different-events-using-logstash/231229/2 "2020-06-02T21:55:58Z")

</div>

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