Getting Data In

Timestamp broken up by a |

ubko
Explorer

I have events in a file with fields separated by "|" (e.g. blah|blah|20120406|095040|blah|blah).

Can I use this to pick out the date?

TIME_PREFIX = ^(?:[^\|]*\|){2}

How would I combine the time?

Tags (1)
0 Karma

araitz
Splunk Employee
Splunk Employee

Edit to reflect event given in comment below:

TIME_PREFIX=^(([^\|]+)?\|){16}
TIME_FORMAT=%Y%m%d|%H%M%S

ubko
Explorer

This works:

TIME_PREFIX=^(([^|]*)|){16}

Thanks.

0 Karma

araitz
Splunk Employee
Splunk Employee

Yes, I would not expect it to work because the sample event above looks nothing like the event you just posted and the regex isn't properly constructed.

0 Karma

ubko
Explorer

Doesn't work. Here's a sample event:

10|0012028284||55351|J|H|2|1|0|N|N|0|1|15-4-01 S 5||0|20110209|154343|20110209|154343|20110209|234343|1|1|0|1|0|0|-1|-1|

Here's the props.conf:

[test]
REPORT-test = test_fields
TIME_PREFIX = ^(([^|]+)|){16}
TIME_FORMAT = %Y%m%d|%H%M%S

0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...