# Logstash Dissect Filter - Multiple Delimiters?

**URL:** https://discuss.elastic.co/t/logstash-dissect-filter-multiple-delimiters/155626
**Category:** Logstash
**Created:** [November 6, 2018, 9:38pm UTC](https://discuss.elastic.co/t/logstash-dissect-filter-multiple-delimiters/155626 "2018-11-06T21:38:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![boss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boss/32/37352_2.png) [@boss](https://discuss.elastic.co/u/boss)
#### Post date: [November 6, 2018, 9:38pm UTC](https://discuss.elastic.co/t/logstash-dissect-filter-multiple-delimiters/155626/1 "2018-11-06T21:38:46Z")

</div>

Hi all, what is the the best way to support multiple delimiters with the Logstash Dissect Filter?

As an example, suppose one file has logs set up as follows:  
`2018-11-06_05:30:21 Log message1`  
And another file has logs set up as such:  
`2018-11-06-05:30:21 Log message 2`  
Note the different delimiter between the date and time.

I want to use the same filter for both log files. What is the preferred way to handle this?  
I haven't had any luck with the following Logstash filter:

```
filter {
   dissect { 
      mapping => { 
         "message" => "%{year}-%{month}-%{day}{_,-}%{hour}:%{min}:%{sec} %{msg}"
      }
   }
}

```

The `{_,-}` (a [common glob pattern](http://www.jedit.org/users-guide/globs.html)) breaks my parsing. Is there any support for this? Or would I just be better off with two separate filters?

Thanks in advance!

Matt

---

<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 4, 2018, 9:38pm UTC](https://discuss.elastic.co/t/logstash-dissect-filter-multiple-delimiters/155626/2 "2018-12-04T21:38:52Z")

</div>

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