Getting Data In

how to set a timestamp that is in brackets?

a212830
Champion

Hi,

How would I set the timestamp for a feed that starts with the timestamp in brackets? How do I tell it to ignore the brackets on each end?

[Tue Dec 18 18:42:31 2012]

Tags (1)
0 Karma

yannK
Splunk Employee
Splunk Employee

If the timestamp is detected, it will ignore them, simply because at index time the timestamp is internally converted to an epoch time (in seconds) and displayed in the timezone of your search-head / project.

If you want to manually extract the timestamp at search time, like with a field extraction, you can parse it as you want.

example

| rex field=mytimestamp mode=sed "/s/\[\]//g" | table mytimestamp

or

| rex field=_raw "\[(?< mytimestamp >.*)\]" | table mytimestamp

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...