Getting Data In

How can I configure Splunk to parse the date and time from my sample log?

jacksonecac
New Member

I am probably having a simple problem that me being a Splunk noobie is having trouble solving. I have logs that I would like to parse the datetime out of. However, since they are not a field, I think that I need to rex them and set them to a field. If this is the case. How do I do it? The logs are formatted like:

\####[2016-11-17 08:02:09.028].... <br/>
...

I would like to pull the datetime out of the log and use it as a field to filter on. How can I achieve this?

thanks in advance!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You should be able to do that using these props.conf settings.

TIME_PREFIX = ###[
TIME_FORMAT = %Y-%m-%d %H:%M:%S.%3N
---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...