<?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: Timestamp format in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Timestamp-format-being-ignored/m-p/599866#M104591</link>
    <description>&lt;P&gt;Because HEC input expects the time field to contain unix timestamp with fraction part delimited by a dot, not a comma. It's jusy how it works. The "timeformat" here is not redefineable. This is just how it works.&lt;/P&gt;&lt;P&gt;Oh, and by default, when you use HEC the timestamp is &lt;U&gt;not&lt;/U&gt; extracted from the raw event but is either read from the time field supplied &lt;U&gt;with&lt;/U&gt; the event (as you did in your example) or assumed from the system time. In order to parse timestamp from the event data you'd have to &lt;U&gt;not&lt;/U&gt; provide the time field and add "?auto_extract_timestamp=true" to your REST endpoint url.&lt;/P&gt;&lt;P&gt;Notice that in your example you don't have any time-related info &lt;U&gt;in&lt;/U&gt; the event.&lt;/P&gt;</description>
    <pubDate>Tue, 31 May 2022 10:20:58 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2022-05-31T10:20:58Z</dc:date>
    <item>
      <title>Why is Timestamp format being ignored?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Timestamp-format-being-ignored/m-p/599844#M104586</link>
      <description>&lt;P&gt;Problem:&lt;BR /&gt;Timestamp format setting is ignored when sending request&lt;/P&gt;
&lt;P&gt;I have created SourceType "test" with settings&lt;BR /&gt;Timestamp format: &lt;STRONG&gt;%s,%3N&lt;/STRONG&gt;&lt;BR /&gt;Timestamp fields: &lt;STRONG&gt;time&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Created HTTP Event Collector with settings&lt;BR /&gt;Source Type: test&lt;BR /&gt;Restarted Splunk&lt;BR /&gt;&lt;BR /&gt;And when making a request&lt;BR /&gt;&lt;A href="http://banana:8088/services/collector/event/1.0" target="_blank" rel="noopener"&gt;http://banana:8088/services/collector/event/1.0&lt;/A&gt;&lt;BR /&gt;Body:&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;"time":"1653643363,529",&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "sourcetype": "test",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "event":{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "id":"1",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "severity":"Information",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "message":"Test",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Response with status 400 is returned&lt;BR /&gt;"text": "Error in handling indexed fields",&lt;BR /&gt;"code": 15,&lt;BR /&gt;"invalid-event-number": 0&lt;/P&gt;
&lt;P&gt;Why is timestamp format ignored (works with "." but not with ",")?&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Timestamp-format-being-ignored/m-p/599844#M104586</guid>
      <dc:creator>mala_banana</dc:creator>
      <dc:date>2022-05-31T14:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Timestamp-format-being-ignored/m-p/599866#M104591</link>
      <description>&lt;P&gt;Because HEC input expects the time field to contain unix timestamp with fraction part delimited by a dot, not a comma. It's jusy how it works. The "timeformat" here is not redefineable. This is just how it works.&lt;/P&gt;&lt;P&gt;Oh, and by default, when you use HEC the timestamp is &lt;U&gt;not&lt;/U&gt; extracted from the raw event but is either read from the time field supplied &lt;U&gt;with&lt;/U&gt; the event (as you did in your example) or assumed from the system time. In order to parse timestamp from the event data you'd have to &lt;U&gt;not&lt;/U&gt; provide the time field and add "?auto_extract_timestamp=true" to your REST endpoint url.&lt;/P&gt;&lt;P&gt;Notice that in your example you don't have any time-related info &lt;U&gt;in&lt;/U&gt; the event.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 10:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Timestamp-format-being-ignored/m-p/599866#M104591</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-05-31T10:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Timestamp-format-being-ignored/m-p/599874#M104593</link>
      <description>&lt;P&gt;Thank you for quick reply.&lt;BR /&gt;&lt;BR /&gt;Iam using &lt;A href="https://github.com/splunk/splunk-library-dotnetlogging" target="_self"&gt;Splunk.Logging.TraceListener.Core package&lt;/A&gt;&amp;nbsp;and setup is done like in this &lt;A href="https://github.com/splunk/splunk-library-dotnetlogging#sending-events-to-http-event-collector" target="_self"&gt;example&lt;/A&gt;&amp;nbsp;for HTTP Event Collector, TraceListener. But this is using HttpEventCollectorEventInfo with constructor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public HttpEventCollectorEventInfo(DateTime datetime, string id, string severity, string message, object data, Metadata metadata)
        {
            Timestamp = (datetime - new DateTime(1970, 1, 1)).TotalSeconds.ToString("#.000", Thread.CurrentThread.CurrentCulture);
            this.metadata = (metadata ?? new Metadata());
            Event = new LoggerEvent(id, severity, message, data);
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Timestamp format here is dependent on my Culture and if culture has comma as delimiter, requests will always fail. Is there recommended workaround for this?&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 11:04:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Timestamp-format-being-ignored/m-p/599874#M104593</guid>
      <dc:creator>mala_banana</dc:creator>
      <dc:date>2022-05-31T11:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Timestamp-format-being-ignored/m-p/599973#M104615</link>
      <description>&lt;P&gt;Sorry, can't help you here. Touched .Net only once some 15 years ago &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'd say that you need to somehow set proper format for your ToString to produce dot instead of comma but have no idea whatsoever how to do that.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 18:33:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Timestamp-format-being-ignored/m-p/599973#M104615</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-05-31T18:33:37Z</dc:date>
    </item>
  </channel>
</rss>

