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!

Notification Email Migration Announcement

The Notification Team is migrating our email service provider from Postmark to AWS Simple Email Service (SES) ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...