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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...