Splunk Search

How to convert an invalid field to a date?

tcupp
New Member

index=pltwg_shopflex
| eval Time=typeof(event.InventoryEventCarpet.InventoryEventCreateDateTime)
"http://cimsplunk/en-US/app/Plant_WG/ols_production_report_clone/edit"

Typeof for "event.InventoryEventCarpet.InventoryEventCreateDateTime" returns "invalid" as the format.

This is the field "event.InventoryEventCarpet.InventoryEventCreateDateTime =2018-06-07T15:44:03.570".

I want to convert this to a date, then to a week ending field and need help.

Tags (1)
0 Karma

kmaron
Motivator

does it work if you put single quotes around the field?

| eval Time=typeof('event.InventoryEventCarpet.InventoryEventCreateDateTime')
0 Karma

tcupp
New Member

Yes, it comes back as a string. Thanks for helping, have a great week end!

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...