Splunk Search

Using CSV field as time

bvan
Explorer

I have a CSV file with a column labeled published. Timestamp values in that field are listed like so: 

2020-07-01T01:17:02.649Z

I'm trying to use the "published" column as _time for some dashboarding and I'm using:

| inputlookup file.csv | eval _time=strptime("published","%Y-%m-%dT%H:%M:%S.%N")

However, when I run a time chart search it doesn't return any data. Is my eval command formatted correctly or is there something else I'm missing?

Labels (2)
Tags (3)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Try this eval.

 

| eval _time=strptime(published,"%Y-%m-%dT%H:%M:%S.%3N%Z")

 

It may not help.  If not, please share the full search so we can see what else may be off.

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

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Try this eval.

 

| eval _time=strptime(published,"%Y-%m-%dT%H:%M:%S.%3N%Z")

 

It may not help.  If not, please share the full search so we can see what else may be off.

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

bvan
Explorer

Yup! That was it! Thanks so much!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...