Getting Data In
Highlighted

how to set a timestamp that is in brackets?

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
Highlighted

Re: how to set a timestamp that is in brackets?

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