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
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!

Unlocking Unified Insights: New Gigamon Federated Search App for Splunk

In today’s data-heavy environment, organizations are caught in a data distribution dilemma. As data volumes ...

GA: New Data Management App in Splunk Platform

Streamlining Data Management: Introducing a unified experience in Splunk Managing data at scale shouldn’t feel ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...