Splunk Enterprise

Help extracting timestamp from a CSV File

spammenot66
Contributor

I'm trying to extract the "Flash Date" and use it a the time stamp  when I index my csv file. I'm getting random results. Any help would be greatly appreciated. In some cases the event would grab the "start time",in others it would match up to "End Time" 

Question

1) if the field name contains a space, do i need to encase it in double quotes when specifying TIMESTAMP_FIELDS ?

2) Can I use just a date with no time as seen in the values from "Flash date"?

 

My CSV file

Folder,Job Name,Flash Date,Job Status,Start Time,End Time
S1,J1,"July 19, 2020",Ended OK,"July 19, 2020 3:00:121 PM","July 19, 2020 3:00:23" PM
S1,J2,"July 1, 2020",Failed,"July 2, 2020 3:00:21 PM","July 9, 2020 5:00:00 PM"
S1,J3,"July 4, 2020",Failed,"",""
S1,J3,"July 4, 2020",Ended OK,"July 4, 2020 12:00:00 PM",""

 

 

 

 

[my_csv]
CHARSET = UTF-8
INDEXED_EXTRACTIONS = csv
DATETIME_CONFIG =
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIMESTAMP_FIELDS = Flash Date
TIME_FORMAT = %B %d, %Y

 

 

 

 

Labels (1)
0 Karma
1 Solution

to4kawa
Ultra Champion

[ my_csv ]
SHOULD_LINEMERGE=false
LINE_BREAKER=([\r\n]+)
NO_BINARY_CHECK=true
INDEXED_EXTRACTIONS=csv
TIME_FORMAT=%B %d, %Y
TIMESTAMP_FIELDS="Flash Date"
CHARSET=UTF-8

A1) yes.
A2) yes.

View solution in original post

to4kawa
Ultra Champion

[ my_csv ]
SHOULD_LINEMERGE=false
LINE_BREAKER=([\r\n]+)
NO_BINARY_CHECK=true
INDEXED_EXTRACTIONS=csv
TIME_FORMAT=%B %d, %Y
TIMESTAMP_FIELDS="Flash Date"
CHARSET=UTF-8

A1) yes.
A2) yes.

spammenot66
Contributor

thanks @to4kawa  for the quick response.  I'm trying it out now. 

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...