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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...