# Parse logs with timezone

**URL:** <https://discuss.elastic.co/t/parse-logs-with-timezone/206628>\
**Category:** Logstash\
**Created:** [November 5, 2019, 2:34pm UTC](https://discuss.elastic.co/t/parse-logs-with-timezone/206628 "2019-11-05T14:34:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kate1](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kate1](https://discuss.elastic.co/u/kate1)\
**Post date:** [November 5, 2019, 2:34pm UTC](https://discuss.elastic.co/t/parse-logs-with-timezone/206628/1 "2019-11-05T14:34:56Z")

</div>

I'm trying to parse some logs with 2 type  
`<Sep 16, 2019 9:58:23 AM MSK> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>`  
and  
` --- Mon Sep 16 11:30:20 MSK 2019 WSLoggerQueue Left: 0, Out: 4 ---`  
I can`t parsed second string. I get an error all the time. My logstash config:  
filter {

```
	if ([index] == "app-test") and [ls_type] == 'out' {
	
		grok {
			patterns_dir => "/usr/share/logstash/pipeline/patterns"
			match => ["message","%{WLS_OUT_EVENTLOG:[@metadata][timestamp]}" ] #<May 23, 2016 10:01:00 AM MSK> 
		}
		grok {
			patterns_dir => "/usr/share/logstash/pipeline/patterns"
			match => ["message","%{WLS_OUT_TS:[@metadata][timestamp]}" ] #--- Thu Oct 31 13:33:12 MSK 2019
		}
		date {
			match => ["[@metadata][timestamp]" , "MMM dd, yyyy h:mm:ss a" ]
			timezone => "Europe/Moscow"
		}
		date {
			match => ["[@metadata][timestamp]" , "EEE MMM dd HH:mm:ss YYYY" ]
			timezone => "Europe/Moscow"
		}
		
	}
}

```

My grok pattern:  
WLS\_OUT\_EVENTLOG %{MONTH} %{MONTHDAY}, %{YEAR} %{HOUR}:%{MINUTE}:%{SECOND} (AM|PM)  
WLS\_OUT\_TS %{DAY} %{MONTH} %{MONTHDAY} %{TIME}  
Pls, help

---

<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 3, 2019, 2:35pm UTC](https://discuss.elastic.co/t/parse-logs-with-timezone/206628/2 "2019-12-03T14:35:02Z")

</div>

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