<?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: Unable to match field with strptime in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-match-field-with-strptime/m-p/251853#M75292</link>
    <description>&lt;P&gt;May just be a simple typo. You strptime format is missing a &lt;CODE&gt;%&lt;/CODE&gt;. This works&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval StartTime="2016-08-26 15:18:32.97" | eval EndTime="2016-08-26 15:18:38.4" | eval stime=strptime(StartTime,"%Y-%m-%d %H:%M:%S.%3N") | eval etime=strptime(EndTime,"%Y-%m-%d %H:%M:%S.%3N") | table StartTime EndTime stime etime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 Aug 2016 16:03:04 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-08-26T16:03:04Z</dc:date>
    <item>
      <title>Unable to match field with strptime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-match-field-with-strptime/m-p/251852#M75291</link>
      <description>&lt;P&gt;Hello all, I'm trying to calculate the amount of time a job took to run from an event that looks like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-08-26 11:18:44 HistoryId="1710410", JobSource="861638A0-67C8-4661-B788-E615363436FA", JobId="6989A4FF-BD2B-43D6-8520-69A8A064600E", QueueTime="2016-08-26 15:18:32.147", StartTime="2016-08-26 15:18:32.97", EndTime="2016-08-26 15:18:38.4", AgentId="FD64361C-2F23-4496-9B69-3DDDD0D4DBA0", Result="0", ResultMessage="[Common Structures Warehouse Sync]:  ---&amp;gt; MakeDataChanges() result=NoChangesPending. ---&amp;gt; Result: Succeeded", QueuedReasons="1", QueueFlags="0", Priority="7"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently doing the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=application | lookup tfs_jobs jobID as JobId OUTPUT jobName | eval stime=strptime(StartTime,"Y-%m-%d %H:%M:%S.%3N") | eval etime=strptime(EndTime,"Y-%m-%d %H:%M:%S.%3N") | table stime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just to see if I can match the "StartTime" field.&lt;/P&gt;

&lt;P&gt;But appears that stime is not even populated because the table is blank.  This event is coming from a MSSQL backend and I'm not 100% i'm matching the millisecond time at the end .97 correctly. I've also seen events come in as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-08-26 10:48:44 HistoryId="1710403", JobSource="861638A0-67C8-4661-B788-E615363436FA", JobId="6989A4FF-BD2B-43D6-8520-69A8A064600E", QueueTime="2016-08-26 14:48:32.147", StartTime="2016-08-26 14:48:33.403", EndTime="2016-08-26 14:48:35.567", AgentId="FD64361C-2F23-4496-9B69-3DDDD0D4DBA0", Result="0", ResultMessage="[Common Structures Warehouse Sync]:  ---&amp;gt; MakeDataChanges() result=NoChangesPending. ---&amp;gt; Result: Succeeded", QueuedReasons="1", QueueFlags="0", Priority="7"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which makes me conclude it's in milliseconds and I'm using the %3N. &lt;/P&gt;

&lt;P&gt;Any assistance on what I'm doing wrong would be appreciated.&lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 15:53:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-match-field-with-strptime/m-p/251852#M75291</guid>
      <dc:creator>dondky</dc:creator>
      <dc:date>2016-08-26T15:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to match field with strptime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-match-field-with-strptime/m-p/251853#M75292</link>
      <description>&lt;P&gt;May just be a simple typo. You strptime format is missing a &lt;CODE&gt;%&lt;/CODE&gt;. This works&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval StartTime="2016-08-26 15:18:32.97" | eval EndTime="2016-08-26 15:18:38.4" | eval stime=strptime(StartTime,"%Y-%m-%d %H:%M:%S.%3N") | eval etime=strptime(EndTime,"%Y-%m-%d %H:%M:%S.%3N") | table StartTime EndTime stime etime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Aug 2016 16:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-match-field-with-strptime/m-p/251853#M75292</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-26T16:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to match field with strptime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-match-field-with-strptime/m-p/251854#M75293</link>
      <description>&lt;P&gt;Thank you! The %Y was the culprit. &lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 17:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-match-field-with-strptime/m-p/251854#M75293</guid>
      <dc:creator>dondky</dc:creator>
      <dc:date>2016-08-30T17:51:16Z</dc:date>
    </item>
  </channel>
</rss>

