Reporting

Need help in writing regex

Praz_123
Communicator

Hi 

I need the same time in events and _time  while importing the data getting the time difference what to write in time_prefix field 

Praz_123_1-1749108268066.png

 

Labels (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Praz_123 ,

could you share a sample of your logs in text format?

Ciao.

Giuseppe

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Praz_123 

In props.conf, use the following settings to extract the timestamp in your sourcetype:

 
[yourSourcetype]
TIME_PREFIX = ^"
TIME_FORMAT = %m/%d/%y %H:%M:%SZ

Explanation:

  • TIME_PREFIX anchors the timestamp extraction immediately after the opening quote at the start of the line.
  • TIME_FORMAT matches the date/time format: month/day/two-digit year, space, hour:minute:second, and a trailing "Z" for UTC.

For more info check out https://docs.splunk.com/Documentation/Splunk/latest/Data/Configuretimestamprecognition

If you are able to share a raw event (redacted if required) we can validate it but the above should hopefully work.

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...