Splunk Search

Unwanted characters in time stamp

Oakley
Explorer

I have a log with a timestamp that looks like this:

<135>May 24 03:20:33

I'm no regexp expert so I am asking, what is the best way ofe getting rid of the <135> characters?

Tags (2)
0 Karma
1 Solution

bwooden
Splunk Employee
Splunk Employee

Are you wanting to remove it for reporting purposes or to ensure Splunk accurately extracts the timestamp?

To ensure Splunk accurately extracts the timestamp, you may add this to your props.conf beneath the applicable sourcetype, host, or source stanza:

[relevant_stanza]
TIME_PREFIX = ^\<[^\>]+\>

You could also add the following settings in the same place. They would help with efficiency a bit but likely not be required:

MAX_TIMESTAMP_LOOKAHEAD = 30
TIME_FORMAT = %b %d %T

The <135> shouldn't bother you during search time, but if it does - you can easily work around it using one of many techniques. Please let us know if it is a search-time question (with an example) and we'll focus on that instead.

View solution in original post

bwooden
Splunk Employee
Splunk Employee

Are you wanting to remove it for reporting purposes or to ensure Splunk accurately extracts the timestamp?

To ensure Splunk accurately extracts the timestamp, you may add this to your props.conf beneath the applicable sourcetype, host, or source stanza:

[relevant_stanza]
TIME_PREFIX = ^\<[^\>]+\>

You could also add the following settings in the same place. They would help with efficiency a bit but likely not be required:

MAX_TIMESTAMP_LOOKAHEAD = 30
TIME_FORMAT = %b %d %T

The <135> shouldn't bother you during search time, but if it does - you can easily work around it using one of many techniques. Please let us know if it is a search-time question (with an example) and we'll focus on that instead.

Oakley
Explorer

Thanks! Just what I was looking for. 🙂

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...