Splunk Search

How to remove the timezone from my field in a CSV file?

PRIYANKA_1993
New Member

I'm fetching the data from a CSV file, but the issue with my data is that some of the values are in PDT and some are in PST.

The format is 2016-06-15 04:55 PM PDT. I just want all these values to be of same zone minus the time zone at the end. I want to display my data over a timechart.

0 Karma
1 Solution

sundareshr
Legend

Try this

| inputlookup xxx.csv | eval time=strptime(your_time_field,"%Y-%m-%d %H:%M %p %Z") | bin span=15m time | stats count by time | eval time=strftime(time, "%c")

View solution in original post

0 Karma

sundareshr
Legend

Try this

| inputlookup xxx.csv | eval time=strptime(your_time_field,"%Y-%m-%d %H:%M %p %Z") | bin span=15m time | stats count by time | eval time=strftime(time, "%c")
0 Karma

chanmi2
Path Finder

Hope this can help:

|inputlookup xxx.csv | eval _time=strptime(your_time_field,"%Y-%m-%d %H:%M %p %Z") | timechart span=5m count

the display time zone will be the user time zone, same as server time zone by default
the time format could be found in
http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Commontimeformatvariables

0 Karma

PRIYANKA_1993
New Member

For some strange reason it is not showing any results.

0 Karma

chanmi2
Path Finder

could you remove |timechart span=5m count, and check if the _time is parsed correctly?

0 Karma

PRIYANKA_1993
New Member

After I changed the name of my time field, _time is getting parsed.

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Could you post your current search? Is the data from CSV being ingested to Splunk OR being used as lookup table OR direct csv access (inputcsv)?

0 Karma

PRIYANKA_1993
New Member

I am using inputlookup

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...