<?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: Replace space in timestamp with a 0 (with datetime.xml possibly?) in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/535228#M89762</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is the closest I have gotten it so far, but it doesn't look like it's treating the spaces as zeros, it's just ignoring them.&lt;/P&gt;&lt;P&gt;It indexed&amp;nbsp;&lt;SPAN class="t"&gt;01-08-2021:11.28.23.&lt;/SPAN&gt; &lt;SPAN class="t"&gt;8213 as&amp;nbsp;&lt;SPAN&gt;1/8/21&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;11:28:23.821 AM&amp;nbsp; -&amp;nbsp; that is better than what it was doing before, but still not quite right.&amp;nbsp; It should be indexed as&amp;nbsp;1/8/21&amp;nbsp;11:28:23.&lt;STRONG&gt;00&lt;/STRONG&gt;8213 AM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jan 2021 16:39:47 GMT</pubDate>
    <dc:creator>pestatp</dc:creator>
    <dc:date>2021-01-08T16:39:47Z</dc:date>
    <item>
      <title>Replace space in timestamp with a 0 (with datetime.xml possibly?) - Whitespace Padded Microseconds</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/531711#M89432</link>
      <description>&lt;P&gt;I have events that unfortunately use a space instead of a 0 in their timestamp field.&amp;nbsp; The timestamp goes down to 6 decimal places, so there can be as many as 5 leading spaces in the decimal seconds section.&amp;nbsp; Each event starts with the timestamp as below.&amp;nbsp; As you can see, it has a leading space and I'd like to change that to a 0&lt;/P&gt;&lt;PRE&gt;[12-02-2020:08.31.44. 15133] SIP IN:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I have tried using SEDCMD in the props.conf, but it didn't seem to work on the newly indexed events, is my regex not correct or am I way off?&lt;/P&gt;&lt;PRE&gt;[sip_sbc]
SEDCMD-replace_space=s/^(\[[0-9-:\.]{20}\]) ()/\10\2/g&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;: This is my current props.conf settings.&amp;nbsp; This works fine for the timestamps that have 6 digits after the . but any of them that have leading spaces fail to get the proper timestamp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[sip_sbc]
BREAK_ONLY_BEFORE_DATE = 
DATETIME_CONFIG = 
LINE_BREAKER = ----------------------------------------------------------------------------------------([\r\n]+)
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIME_FORMAT = %m-%d-%Y:%H.%M.%S.%6N
TIME_PREFIX = [
category = Custom
pulldown_type = 1
BREAK_ONLY_BEFORE_TIME = 
disabled = false
MUST_BREAK_AFTER = &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit No. 2:&lt;/STRONG&gt;&amp;nbsp; I have added a custom datetime.xml file for the app.&amp;nbsp; It does have an effect, but it's not working quite right.&amp;nbsp; It doesn't pad the leading spaces to 0, it just removes the space and therefor causes the subseconds to be much higher than they are supposed to be on some timestamps.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;datetime&amp;gt;
    &amp;lt;define name="custom_dateformat" extract="month, day, year"&amp;gt;
        &amp;lt;text&amp;gt;&amp;lt;![CDATA[\[(\d+)-(\d+)-(\d+)]]&amp;gt;&amp;lt;/text&amp;gt;
    &amp;lt;/define&amp;gt;
    &amp;lt;define name="custom_timeformat" extract="hour, minute, second, subsecond"&amp;gt;
        &amp;lt;text&amp;gt;&amp;lt;![CDATA[\[\d+-\d+-\d+:(\d+).(\d+).(\d+).\s*(\d+)]]&amp;gt;&amp;lt;/text&amp;gt;
    &amp;lt;/define&amp;gt;
    &amp;lt;timePatterns&amp;gt;
        &amp;lt;use name="custom_timeformat" /&amp;gt;
    &amp;lt;/timePatterns&amp;gt;
    &amp;lt;datePatterns&amp;gt;
        &amp;lt;use name="custom_dateformat" /&amp;gt;
    &amp;lt;/datePatterns&amp;gt;
&amp;lt;/datetime&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This datetime.xml caused an event with the timestamp:&amp;nbsp;&lt;SPAN class=""&gt;01-08-2021:11.28.23.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;8213 (note the 2 spaces before 8213)&amp;nbsp; to be parsed as&amp;nbsp;&lt;SPAN&gt;1/8/21&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;11:28:23.821&amp;nbsp; (this is 8 10ths of a second after the timestamp should be)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It should be&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN&gt;1/8/21&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;11:28:23.008213&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 13:28:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/531711#M89432</guid>
      <dc:creator>pestatp</dc:creator>
      <dc:date>2021-11-04T13:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Replace space in timestamp with a 0</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/531725#M89435</link>
      <description>&lt;P&gt;Can you ignore the microseconds part of the timestamp?&lt;/P&gt;&lt;P&gt;IIRC, SEDCMD executes after timestamp extraction so there's nothing it can do to a timestamp.&lt;/P&gt;&lt;P&gt;Perhaps Cribl can do the job.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 15:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/531725#M89435</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-12-02T15:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Replace space in timestamp with a 0</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/531727#M89436</link>
      <description>&lt;P class="lia-align-left"&gt;No, I cannot ignore it.&amp;nbsp; These are SIP messages and they need to be in as precise order as possible to ensure the call flow is correct.&amp;nbsp; Many of the messages are within just a few thousandths of a second of each other.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 15:55:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/531727#M89436</guid>
      <dc:creator>pestatp</dc:creator>
      <dc:date>2020-12-02T15:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Replace space in timestamp with a 0</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/535198#M89757</link>
      <description>&lt;P&gt;After some more searching, I came across datetime.xml.&amp;nbsp; It looks like that can be used to do custom datetime extraction although, I am a bit confused by the documentation.&amp;nbsp; Does anyone know if that would work for this scenario?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 14:30:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/535198#M89757</guid>
      <dc:creator>pestatp</dc:creator>
      <dc:date>2021-01-08T14:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Replace space in timestamp with a 0</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/535216#M89759</link>
      <description>&lt;P&gt;Yes, the datetime.xml file can be customized.&amp;nbsp; It should be pretty straightforward to add support for 9 decimal places.&amp;nbsp; Look for where subseconds are extracted from the pattern that matches your time format.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 15:25:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/535216#M89759</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-08T15:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Replace space in timestamp with a 0 (with datetime.xml possibly?)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/535225#M89761</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/46890"&gt;@pestatp&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you try below datetime.xml?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;datetime&amp;gt;
    &amp;lt;define name="custom_dateformat" extract="month, day, year"&amp;gt;
        &amp;lt;text&amp;gt;&amp;lt;![CDATA[\[(\d+)-(\d+)-(\d+)]]&amp;gt;&amp;lt;/text&amp;gt;
    &amp;lt;/define&amp;gt;
    &amp;lt;define name="custom_timeformat" extract="hour, minute, second, subsecond"&amp;gt;
        &amp;lt;text&amp;gt;&amp;lt;![CDATA[\[\d+-\d+-\d+:(\d+).(\d+).(\d+).\s*(\d+)]]&amp;gt;&amp;lt;/text&amp;gt;
    &amp;lt;/define&amp;gt;
    &amp;lt;timePatterns&amp;gt;
        &amp;lt;use name="custom_timeformat" /&amp;gt;
    &amp;lt;/timePatterns&amp;gt;
    &amp;lt;datePatterns&amp;gt;
        &amp;lt;use name="custom_dateformat" /&amp;gt;
    &amp;lt;/datePatterns&amp;gt;
&amp;lt;/datetime&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you an upvote is appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 15:57:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/535225#M89761</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-08T15:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Replace space in timestamp with a 0 (with datetime.xml possibly?)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/535228#M89762</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is the closest I have gotten it so far, but it doesn't look like it's treating the spaces as zeros, it's just ignoring them.&lt;/P&gt;&lt;P&gt;It indexed&amp;nbsp;&lt;SPAN class="t"&gt;01-08-2021:11.28.23.&lt;/SPAN&gt; &lt;SPAN class="t"&gt;8213 as&amp;nbsp;&lt;SPAN&gt;1/8/21&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;11:28:23.821 AM&amp;nbsp; -&amp;nbsp; that is better than what it was doing before, but still not quite right.&amp;nbsp; It should be indexed as&amp;nbsp;1/8/21&amp;nbsp;11:28:23.&lt;STRONG&gt;00&lt;/STRONG&gt;8213 AM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 16:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/535228#M89762</guid>
      <dc:creator>pestatp</dc:creator>
      <dc:date>2021-01-08T16:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Replace space in timestamp with a 0 (with datetime.xml possibly?)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/573619#M101457</link>
      <description>&lt;P&gt;I have still not been able to figure this out.&amp;nbsp; I haven't seen anything in newer versions that would help with this, anyone know of anything?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 12:54:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Replace-space-in-timestamp-with-a-0-with-datetime-xml-possibly/m-p/573619#M101457</guid>
      <dc:creator>pestatp</dc:creator>
      <dc:date>2021-11-04T12:54:36Z</dc:date>
    </item>
  </channel>
</rss>

