<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: What's the best way to handle multiple different time formats in the same source? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757512#M120147</link>
    <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;yes totally right that neither are intuitive - it should be a Catalina thing. I know we had the same issue with a custom Tomcat app that had multiple date formats and we pushed back to get them fixed, which got traction.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jan 2026 22:12:41 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2026-01-20T22:12:41Z</dc:date>
    <item>
      <title>What's the best way to handle multiple different time formats in the same source?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757464#M120141</link>
      <description>&lt;P&gt;Hello Splunk Community,&lt;/P&gt;&lt;P&gt;My team is currently processing logs from a single source that can contain events with different timestamp formats. We are debating the best configuration approach and would like input from the community.&lt;/P&gt;&lt;H2&gt;Option 1: Using props.conf with transforms (Current setup)&lt;/H2&gt;&lt;P&gt;We are currently using a TRANSFORMS-split rule in our props.conf file to differentiate the source types based on some criteria, and then applying a single TIME_FORMAT within each resulting source type stanza. This involves creating several dedicated source types for essentially the same data stream.&lt;/P&gt;&lt;H3&gt;Configuration Snippet Example:&lt;/H3&gt;&lt;PRE&gt;[xxx:tomcat9:catalina1]
SHOULD_LINEMERGE=false
LINE_BREAKER=([\r\n]+)
TIME_FORMAT=%d-%b-%Y %H:%M:%S
TIME_PREFIX=^
MAX_TIMESTAMP_LOOKAHEAD=20
TRANSFORMS-split = catalina1, catalina2

[tomcat9stdout1]
REGEX = \d+\-[a-zA-Z]+-\d+\s\d+\:\d+\:\d+
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::xxx:tomcat9:stdout1

[tomcat9stdout2]
REGEX = [0-9]{4}\-\d+\-\d+\s\d+\:\d+\:\d+
... (etc for other formats)&lt;/PRE&gt;&lt;H2&gt;Option 2: Using datetime.xml&lt;/H2&gt;&lt;P&gt;The alternative approach suggested is to use a single source type and configure a datetime.xml file. This XML file would contain multiple regular expressions, allowing Splunk to iterate through them and automatically identify the correct timestamp format for each individual event.&lt;/P&gt;&lt;H2&gt;Question&lt;/H2&gt;&lt;P&gt;Which approach is considered the industry best practice for handling this specific scenario? Is the datetime.xml method generally more robust and maintainable than splitting source types via transforms?&lt;/P&gt;&lt;P&gt;Thanks for your guidance!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2026 19:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757464#M120141</guid>
      <dc:creator>spl_aficionado</dc:creator>
      <dc:date>2026-01-19T19:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to handle multiple different time formats in the same source?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757476#M120142</link>
      <description>&lt;P&gt;I'm not sure about best practice, but splitting the same stream into multiple sourcetypes just to handle different data format seems non-intuitive.&lt;/P&gt;&lt;P&gt;What about using INGEST_EVAL to extract _time with a bunch of eval statements to extract _time, e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;INGEST_EVAL _time = coalesce(strptime(_raw, "%FT%T"), strptime(_raw, "%d-%b-%Y %H:%M:%S"), strptime(_raw, ...))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 05:46:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757476#M120142</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2026-01-20T05:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to handle multiple different time formats in the same source?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757488#M120143</link>
      <description>&lt;P&gt;Neither will be intuitive (I disagree here a bit with&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;). By definition all events from a given sourcetype should share common format so if you have different time formats it would be natural for me to split it into separate sourcetypes but the split itself is a bit tricky - it won't work the way you're describing because timestamp recognition is happening at the very beginning of the ingestion pipeline and even if you recast your sourcetype it won't happen again. Even if you CLONE_SOURCETYPE your duplicated event will be reinjected into the queue after the timestamp recognition phase.&lt;/P&gt;&lt;P&gt;With syslog-provided events it's usually relatively easy because you can split your event stream into multiple sourcetypes before it hits Splunk. With files... it's gonna be tricky. Probably&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;'s approach with dynamic overwrites of the already extracted (or assigned because extraction might not happen properly for misformatted timestamps) might be the way to go. But it's worth docummenting extensively because it's not intuitive.&lt;/P&gt;&lt;P&gt;BTW, catalina.out is a mess&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 09:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757488#M120143</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2026-01-20T09:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to handle multiple different time formats in the same source?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757499#M120144</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;, thank you for your insightful replies !&lt;/P&gt;&lt;P&gt;Looking at the official props.conf documentation, and it seems clear that datetime.xml is the best practice for these situations -&amp;nbsp;&lt;A href="https://help.splunk.com/en/splunk-enterprise/administer/admin-manual/10.2/configuration-file-reference/10.2.0-configuration-file-reference/props.conf#:~:text=DATETIME_CONFIG%20%3D%20%5B%3Cfilename%20relative%20to%20%24SPLUNK_HOME%3E%20%7C%20CURRENT%20%7C%20NONE%5D" target="_self"&gt;props.conf.&lt;/A&gt;&amp;nbsp; what do you think?&lt;/P&gt;&lt;P&gt;I also wonder if the official Tomcat TA covers it, but looking briefly into the props of the TA, and I don't see any date extraction, which is really strange.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 15:24:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757499#M120144</guid>
      <dc:creator>spl_aficionado</dc:creator>
      <dc:date>2026-01-20T15:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to handle multiple different time formats in the same source?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757510#M120146</link>
      <description>&lt;P&gt;To be fully honest, I've never seen datetime.xml fiddled with. It's a relatively narrow border use case. I'm not sure there's a lot of docs on it either.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 20:09:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757510#M120146</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2026-01-20T20:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to handle multiple different time formats in the same source?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757512#M120147</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;yes totally right that neither are intuitive - it should be a Catalina thing. I know we had the same issue with a custom Tomcat app that had multiple date formats and we pushed back to get them fixed, which got traction.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 22:12:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757512#M120147</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2026-01-20T22:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best way to handle multiple different time formats in the same source?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757518#M120148</link>
      <description>&lt;P&gt;Yes. It's one of the common issues with tomcat (and java in general) logs. But be prepared for more "fun".&lt;/P&gt;&lt;P&gt;1. Java apps often produce multiline stack dumps. And if by any chance you're forwarding those logs via syslog to a remote machine you'll end up with a single "logical event" split into several separate syslog entries. That's horrible to deal with.&lt;/P&gt;&lt;P&gt;2. Developers tend to happily write to logs... just about anything. And in any format (or lack thereof) they can think of. I don't know why but java seems to be one of the cases where the devs are most prolific in coming up with several different ways of formatting events from the same application.&lt;/P&gt;&lt;P&gt;3. It might or might not be an issue, but rotating logs with log4j is (or at least used to be) painful. It's usually not directly an ingestion issue but it might cause problems if you want to keep the log dir tidy - you can't just use logrotate and send HUP to the app.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jan 2026 09:22:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-s-the-best-way-to-handle-multiple-different-time-formats-in/m-p/757518#M120148</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2026-01-21T09:22:45Z</dc:date>
    </item>
  </channel>
</rss>

