Splunk Search

date and time conversion

archanas
Explorer

hi,

 I am looking to convert the following time to UTC format:

8/26/20203:47PM-06:00 

Ultimately i am looking to convert the above format to work week of the year with Monday as start day.

Any help is appreciated.

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

If your problem is resolved, then please click the "Accept as Solution" button to help future readers.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

archanas
Explorer

Thanks a lot. It worked! 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If your problem is resolved, then please click the "Accept as Solution" button to help future readers.

---
If this reply helps you, Karma would be appreciated.
0 Karma

richgalloway
SplunkTrust
SplunkTrust

To convert the time to the time zone of the Splunk server, use this.  Splunk will display the result in your selected time zone.

| eval time=strptime (field, "%m/%d/%Y%H:%M%p%:z")

To display the week number, try this.

| eval ww=strftime(time,"%V")

The %V formatter is for calendar weeks starting on Sunday.  Splunk offers no option for different starting days, but this should fill your requirements.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

How to Get Started with Splunk Data Management Pipeline Builders (Edge Processor & ...

If you want to gain full control over your growing data volumes, check out Splunk’s Data Management pipeline ...

Out of the Box to Up And Running - Streamlined Observability for Your Cloud ...

  Tech Talk Streamlined Observability for Your Cloud Environment Register    Out of the Box to Up And Running ...

Splunk Smartness with Brandon Sternfield | Episode 3

Hello and welcome to another episode of "Splunk Smartness," the interview series where we explore the power of ...