Splunk Search

Field '_time' should have numerical values

Jamietriplet
Explorer

Hi all,

I am new to splunk, and i have got the following error:

"Field '_time' should have numerical values"  when I try to run a timechart command.

I have got a csv file 'try.csv', which I read in some fields to display, but when I initiate a timechart command I get the above error.

The csv file 'try.csv' has a column named _time, which has an ISO8601 time


I would appreciate any guide or help I can get, as I am relatively new to splunk

Thanks

Labels (1)
0 Karma
1 Solution

dataisbeautiful
Communicator

Hi @Jamietriplet 

Sounds like _time is being read as a string not as epochtime, try this

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

 

View solution in original post

dataisbeautiful
Communicator

Hi @Jamietriplet 

Sounds like _time is being read as a string not as epochtime, try this

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

 

Jamietriplet
Explorer

Hi, dataisbeautiful , this worked. Thanks

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Jamietriplet,

to use timechart you must use the -time field that's in epochtime format.

If in your csv you have the _time field in a different format, you have to convert in epochtime (using strptime function in eval command) before the timechart command:

Ciao.

Giuseppe

Jamietriplet
Explorer

Thanks @gcusello 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Ciao @Jamietriplet ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated by all the contributors 😉

0 Karma
Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...