<?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 Timestamping different formats in same sourcetype in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582093#M102559</link>
    <description>&lt;P&gt;All...&lt;/P&gt;&lt;P&gt;Looking to see if anyone has any thoughts on trying to bring in different timestamp formats inside of the same sourcetype.&amp;nbsp; I am working on an issue where we are bringing Crowdstrike data where they are just dumping data into S3 bucket.&amp;nbsp; Some of the data comes into buckets that have specific directories, so I can set sourcetyping at the source level for those:&amp;nbsp; &amp;nbsp;However we have some data coming into the same bucket and the same file, but they may have different formats.&amp;nbsp; Examples of what we are seeing:&lt;/P&gt;&lt;P&gt;"modified_time":"2022-01-10T23:58:25.865570789Z"&lt;/P&gt;&lt;P&gt;"timestamp":"2022-01-21T20:37:37Z"&lt;/P&gt;&lt;P&gt;We have tried defining a datetime.xml and have used the following props settings:&lt;/P&gt;&lt;P&gt;[crowdstrike:edr]&lt;/P&gt;&lt;P&gt;LINE_BREAKER = ([\r\n]+)&lt;/P&gt;&lt;P&gt;MAX_TIMESTAMP_LOOKAHEAD = 30&lt;/P&gt;&lt;P&gt;SHOULD_LINEMERGE = false&lt;/P&gt;&lt;P&gt;#TIME_FORMAT = %s%3N&lt;/P&gt;&lt;P&gt;TIME_PREFIX = "timestamp":|"modified_time":|"_time":|"Time":&lt;/P&gt;&lt;P&gt;#TIME_PREFIX = timestamp&lt;/P&gt;&lt;P&gt;DATETIME_CONFIG = /etc/apps/fmac_crowdstrike_props/datetime.xml&lt;/P&gt;&lt;P&gt;TRANSFORMS-filter-edr-splunkd = crowdstrike_filter_splunk,crowdstrike_filter_splunkforwarder,crowdstrike_filter_endofprocess&lt;/P&gt;&lt;P&gt;TRUNCATE = 999999&lt;/P&gt;&lt;P&gt;disabled = false&lt;/P&gt;&lt;P&gt;kv_mode = json&lt;/P&gt;&lt;P&gt;Please let me know if you have any thoughts on this or ideas that will help.&amp;nbsp; Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jan 2022 21:14:58 GMT</pubDate>
    <dc:creator>baseballnut8200</dc:creator>
    <dc:date>2022-01-21T21:14:58Z</dc:date>
    <item>
      <title>Timestamping different formats in same sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582093#M102559</link>
      <description>&lt;P&gt;All...&lt;/P&gt;&lt;P&gt;Looking to see if anyone has any thoughts on trying to bring in different timestamp formats inside of the same sourcetype.&amp;nbsp; I am working on an issue where we are bringing Crowdstrike data where they are just dumping data into S3 bucket.&amp;nbsp; Some of the data comes into buckets that have specific directories, so I can set sourcetyping at the source level for those:&amp;nbsp; &amp;nbsp;However we have some data coming into the same bucket and the same file, but they may have different formats.&amp;nbsp; Examples of what we are seeing:&lt;/P&gt;&lt;P&gt;"modified_time":"2022-01-10T23:58:25.865570789Z"&lt;/P&gt;&lt;P&gt;"timestamp":"2022-01-21T20:37:37Z"&lt;/P&gt;&lt;P&gt;We have tried defining a datetime.xml and have used the following props settings:&lt;/P&gt;&lt;P&gt;[crowdstrike:edr]&lt;/P&gt;&lt;P&gt;LINE_BREAKER = ([\r\n]+)&lt;/P&gt;&lt;P&gt;MAX_TIMESTAMP_LOOKAHEAD = 30&lt;/P&gt;&lt;P&gt;SHOULD_LINEMERGE = false&lt;/P&gt;&lt;P&gt;#TIME_FORMAT = %s%3N&lt;/P&gt;&lt;P&gt;TIME_PREFIX = "timestamp":|"modified_time":|"_time":|"Time":&lt;/P&gt;&lt;P&gt;#TIME_PREFIX = timestamp&lt;/P&gt;&lt;P&gt;DATETIME_CONFIG = /etc/apps/fmac_crowdstrike_props/datetime.xml&lt;/P&gt;&lt;P&gt;TRANSFORMS-filter-edr-splunkd = crowdstrike_filter_splunk,crowdstrike_filter_splunkforwarder,crowdstrike_filter_endofprocess&lt;/P&gt;&lt;P&gt;TRUNCATE = 999999&lt;/P&gt;&lt;P&gt;disabled = false&lt;/P&gt;&lt;P&gt;kv_mode = json&lt;/P&gt;&lt;P&gt;Please let me know if you have any thoughts on this or ideas that will help.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 21:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582093#M102559</guid>
      <dc:creator>baseballnut8200</dc:creator>
      <dc:date>2022-01-21T21:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamping different formats in same sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582099#M102560</link>
      <description>Hi&lt;BR /&gt;You could use INGEST_EVAL on props.conf with needed if/case etc. syntax to select/calculate correct value for _time. If I recall right there is conf presentation where this is an one example.&lt;BR /&gt;r. Ismo</description>
      <pubDate>Fri, 21 Jan 2022 22:55:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582099#M102560</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2022-01-21T22:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamping different formats in same sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582152#M102561</link>
      <description>&lt;P&gt;Yup. If I remember correctly, date parsing is relatively early on the processing queue so you can't modify the message prior to timestamp extraction. Therefore you can only modify it "post-mortem" &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; with ingest-time eval.&lt;/P&gt;&lt;P&gt;You want this pdf - &lt;A href="https://conf.splunk.com/files/2020/slides/PLA1154C.pdf" target="_blank"&gt;https://conf.splunk.com/files/2020/slides/PLA1154C.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Especially, pages 26+&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 22:41:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582152#M102561</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-01-22T22:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamping different formats in same sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582153#M102562</link>
      <description>&lt;P&gt;Right... so I read the article and felt like this might be a good solution.&amp;nbsp; I have implemented this on our testing box, but now the events are getting stamped with the index time.&amp;nbsp; It seems like the DATETIME_CONFIG=CURRENT is winning, and that the transforms are not doing what I am expecting.&amp;nbsp; Here are the props and transform that I am using below, but maybe I am missing something:&lt;/P&gt;&lt;P&gt;Props:&lt;/P&gt;&lt;P&gt;[crowdstrike:edr]&lt;BR /&gt;DATETIME_CONFIG = CURRENT&lt;BR /&gt;LINE_BREAKER = ([\r\n]+)&lt;BR /&gt;MAX_TIMESTAMP_LOOKAHEAD = 30&lt;BR /&gt;SHOULD_LINEMERGE = false&lt;BR /&gt;TIME_PREFIX = \"timestamp\":|\"modified_time\":|\"_time\":|\"Time\":&lt;BR /&gt;TRUNCATE = 999999&lt;BR /&gt;disabled = false&lt;BR /&gt;kv_mode = json&lt;BR /&gt;TRANSFORMS-extract_date = multiple_timestamp_format&lt;/P&gt;&lt;P&gt;transforms:&lt;/P&gt;&lt;P&gt;[multiple_timestamp_format]&lt;BR /&gt;INGEST_EVAL= _time=case(isnotnull(strptime(_raw, "%Y-%m-%dT%H:%M:%S.%QZ")), strptime(_raw, "%Y-%m-%dT%H:%M:%S.%QZ"), isnotnull(strptime(_raw,"%s%3N")), strptime(_raw, "%s%3N"))&lt;/P&gt;&lt;P&gt;Just let me know what you think...&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 00:37:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582153#M102562</guid>
      <dc:creator>baseballnut8200</dc:creator>
      <dc:date>2022-01-23T00:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamping different formats in same sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582205#M102577</link>
      <description>Hi&lt;BR /&gt;when you are configuring _time recognition manually, (usually) it's best to set "DATETIME_CONFIG = " to avoid any surprises.&lt;BR /&gt;r. Ismo</description>
      <pubDate>Mon, 24 Jan 2022 07:23:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582205#M102577</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2022-01-24T07:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamping different formats in same sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582259#M102587</link>
      <description>&lt;P&gt;Right...&amp;nbsp; according to the .conf presentation, you are supposed to set the DATETIME_CONFIG = CURRENT, which is what I tried.&amp;nbsp; I also commented out the DATETIME_CONFIG to see if that would help, but no luck there.&amp;nbsp; I can try setting the DATETIME_CONFIG="" to see what that gets, but not sure that gets me what I am looking for.&amp;nbsp; Will let you know...&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 13:57:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582259#M102587</guid>
      <dc:creator>baseballnut8200</dc:creator>
      <dc:date>2022-01-24T13:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamping different formats in same sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582300#M102590</link>
      <description>&lt;P&gt;Just for clarity I'd lose the isnotnull and use coalsece instead. It's more readable that way.&lt;/P&gt;&lt;P&gt;Also if your parsing is not working (and thus you're getting index time into them), you can add some constant "fallback" at the end so it always matches and see if it's because the EVAL maches wrongly or is it that it's not run at all.&lt;/P&gt;&lt;P&gt;Like&lt;/P&gt;&lt;PRE&gt;INGEST_EVAL= _time=coalesce(strptime(_raw, "%Y-%m-%dT%H:%M:%S.%QZ"), strptime(_raw, "%Y-%m-%dT%H:%M:%S.%QZ"), strptime(_raw,"%s%3N"), strptime(_raw, "%s%3N"), 1)&lt;/PRE&gt;&lt;P&gt;This way if none of the strptime produces a non-null result, your event should get indexed in 1970 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 17:42:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamping-different-formats-in-same-sourcetype/m-p/582300#M102590</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-01-24T17:42:08Z</dc:date>
    </item>
  </channel>
</rss>

