<?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: How do you calculate SLA with unstructured date format? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431502#M75518</link>
    <description>&lt;P&gt;perfect..this is working...many thanks&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jan 2019 15:07:27 GMT</pubDate>
    <dc:creator>pench2k19</dc:creator>
    <dc:date>2019-01-29T15:07:27Z</dc:date>
    <item>
      <title>How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431486#M75502</link>
      <description>&lt;P&gt;hi guys,&lt;/P&gt;

&lt;P&gt;can you please help me in how we can we  try to convert this value &lt;STRONG&gt;2019-01-28-20-32-49&lt;/STRONG&gt;  to &lt;STRONG&gt;2019-01-28 20:00:00&lt;/STRONG&gt; format . &lt;/P&gt;

&lt;P&gt;And calculate time difference between the two values with the date format  &lt;STRONG&gt;2019-01-28 20:00:00&lt;/STRONG&gt; . Thank you in advance.&lt;/P&gt;

&lt;P&gt;@jkat54 @woodcock @vnravikumar &lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 10:40:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431486#M75502</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2019-01-29T10:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431487#M75503</link>
      <description>&lt;P&gt;hi @pench2k19 &lt;/P&gt;

&lt;P&gt;Does this work for you&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval orig1 = "2019-01-28-20-32-49" 
| eval time1 = strptime(orig1, "%Y-%m-%d-%H-%M-%S") 
| eval orig2 = "2019-01-27-10-11-23" 
| eval time2 = strptime(orig2, "%Y-%m-%d-%H-%M-%S") 
| eval diff = time1-time2 
| eval diff_friendly = tostring(diff, "duration") 
| table orig1 orig2 time1 time2 diff diff_friendly
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it helps&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 10:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431487#M75503</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-01-29T10:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431488#M75504</link>
      <description>&lt;P&gt;thansk for the prompt response @chrisyoungerjds ..let me give more details about the question...i m appending two queries where the first query has expected arival of file in  &lt;STRONG&gt;2019-01-28 20:00:00&lt;/STRONG&gt; and the subsearch has the arrival time of the file in  &lt;STRONG&gt;2019-01-28-20-32-49&lt;/STRONG&gt; . &lt;/P&gt;

&lt;P&gt;I have to  change the date format of the subsearch result  as per the expected time format in the first query and find the difference between them.&lt;/P&gt;

&lt;P&gt;following is the query i m using FYR&lt;/P&gt;

&lt;P&gt;| inputlookup SLA.csv|rename SOR_TDQ_FAIL_SLA_THRESHOLD as SLA_THRESHOLD |eval SLA_THRESHOLD=if(SLA_THRESHOLD == "BUS_DT+0,21:00", "2019-01-28 20:00:00" ,SLA_THRESHOLD) |where SLA_THRESHOLD =="2019-01-28 20:00:00" |table SOR_NAME SLA_THRESHOLD| join type=left SOR_NAME  [ search index=XXX source=XXXhost="wppra06a0337"|rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)&lt;EM&gt;(?\d+-\d+-\d+-\d+-\d+-\d+)&lt;/EM&gt;" |where Datafeed_name!=""|rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$"  |fields SOR_NAME  time_stamp]|dedup SOR_NAME |eval time_diff = (SLA_THRESHOLD - time_stamp)|table SOR_NAME SLA_THRESHOLD time_stamp time_diff &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:00:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431488#M75504</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T23:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431489#M75505</link>
      <description>&lt;P&gt;Hi @pench2k19&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval time1="2019-01-28-20-32-49",time2="2019-01-29-23-10-00" 
| eval epochtime1=strptime(time1,"%Y-%m-%d-%H-%M-%S"), epochtime2=strptime(time2,"%Y-%m-%d-%H-%M-%S") 
| eval newtime1=strftime(epochtime1,"%Y-%m-%d %H:00:00"),newtime2=strftime(epochtime2,"%Y-%m-%d %H:00:00") 
| eval newepoch1=strptime(newtime1,"%Y-%m-%d %H:00:00"),newepoch2=strptime(newtime2,"%Y-%m-%d %H:00:00") 
| eval diff = tostring((newepoch2-newepoch1), "duration") | table time1,time2,epochtime1,epochtime2,newtime1,newtime2,newepoch1,newepoch2,diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 11:33:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431489#M75505</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-01-29T11:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431490#M75506</link>
      <description>&lt;P&gt;i cant use makeresults command..let me explain the question more in detail. &lt;/P&gt;

&lt;P&gt;I have mixing two queries to get the time difference. The main search has expected file arrival time in &lt;STRONG&gt;2019-01-28 20:00:00&lt;/STRONG&gt; format and the sub search has the actual arrival  time in date &lt;STRONG&gt;2019-01-28-20-32-49&lt;/STRONG&gt; format  . &lt;/P&gt;

&lt;P&gt;I have to convert the sub search result format as like the main search result format and calculate the difference.&lt;/P&gt;

&lt;P&gt;I am forwarding the query FYR&lt;/P&gt;

&lt;P&gt;| inputlookup SLA.csv|rename SOR_TDQ_FAIL_SLA_THRESHOLD as SLA_THRESHOLD |eval SLA_THRESHOLD=if(SLA_THRESHOLD == "BUS_DT+0,21:00", "2019-01-28 20:00:00" ,SLA_THRESHOLD) |where SLA_THRESHOLD =="2019-01-28 20:00:00" |table SOR_NAME SLA_THRESHOLD| join type=left SOR_NAME  [ search index=XX source=XX |rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)&lt;EM&gt;(?\d+-\d+-\d+-\d+-\d+-\d+)&lt;/EM&gt;" |where Datafeed_name!=""|rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$"  |fields SOR_NAME  time_stamp]|dedup SOR_NAME |eval time_diff = (SLA_THRESHOLD - time_stamp)|table SOR_NAME SLA_THRESHOLD time_stamp time_diff&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431490#M75506</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T22:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431491#M75507</link>
      <description>&lt;P&gt;If you want to format &lt;CODE&gt;diff&lt;/CODE&gt; use this &lt;CODE&gt;| eval duration2=replace(diff,"(\d*)\+*(\d+):(\d+):(\d+)","\1 day(s) \2 hour(s) \3 minute(s) \4 sec(s)")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 11:55:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431491#M75507</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-01-29T11:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431492#M75508</link>
      <description>&lt;P&gt;i have been joining two quries and calculate the time difference. In the main search i have got the time format as &lt;STRONG&gt;2019-01-28 20:00:00&lt;/STRONG&gt;  and in the subsearch i have got the time format as &lt;STRONG&gt;2019-01-28-20-32-49&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;Now i want convert the &lt;STRONG&gt;2019-01-28-20-32-49&lt;/STRONG&gt; into value like this &lt;STRONG&gt;2019-01-28 20:32:49&lt;/STRONG&gt; and calculate the time difference.&lt;/P&gt;

&lt;P&gt;following is the  query i  m using FYR &lt;/P&gt;

&lt;P&gt;| inputlookup SLA.csv|table SOR_NAME SLA_THRESHOLD| join type=left SOR_NAME  [ search index=xx source=xx|rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)&lt;EM&gt;(?\d+-\d+-\d+-\d+-\d+-\d+)&lt;/EM&gt;" |where Datafeed_name!=""|rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$"  |fields SOR_NAME  time_stamp]|dedup SOR_NAME |eval time_diff = (SLA_THRESHOLD - time_stamp)|table SOR_NAME SLA_THRESHOLD time_stamp time_diff&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431492#M75508</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T22:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431493#M75509</link>
      <description>&lt;P&gt;thanks for the quick response @chrisyoungerjds &lt;BR /&gt;
let me give more details about my question &lt;/P&gt;

&lt;P&gt;i have been joining two quries and calculate the time difference. In the main search i have got the time format as &lt;STRONG&gt;2019-01-28 20:00:00&lt;/STRONG&gt;  and in the subsearch i have got the time format as &lt;STRONG&gt;2019-01-28-20-32-49&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;Now i want convert the &lt;STRONG&gt;2019-01-28-20-32-49&lt;/STRONG&gt; into value like this &lt;STRONG&gt;2019-01-28 20:32:49&lt;/STRONG&gt; and calculate the time difference.&lt;/P&gt;

&lt;P&gt;following is the  query i  m using FYR &lt;/P&gt;

&lt;P&gt;| inputlookup SLA.csv|table SOR_NAME SLA_THRESHOLD| join type=left SOR_NAME  [ search index=xx source=xx|rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)&lt;EM&gt;(?\d+-\d+-\d+-\d+-\d+-\d+)&lt;/EM&gt;" |where Datafeed_name!=""|rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$"  |fields SOR_NAME  time_stamp]|dedup SOR_NAME |eval time_diff = (SLA_THRESHOLD - time_stamp)|table SOR_NAME SLA_THRESHOLD time_stamp time_diff&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:58:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431493#M75509</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T22:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431494#M75510</link>
      <description>&lt;P&gt;let me explain the question more in detail&lt;/P&gt;

&lt;P&gt;i have been joining two quries and calculate the time difference. In the main search i have got the time format as &lt;STRONG&gt;2019-01-28 20:00:00&lt;/STRONG&gt;  and in the subsearch i have got the time format as &lt;STRONG&gt;2019-01-28-20-32-49&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;Now i want convert the &lt;STRONG&gt;2019-01-28-20-32-49&lt;/STRONG&gt; into value like this &lt;STRONG&gt;2019-01-28 20:32:49&lt;/STRONG&gt; and calculate the time difference.&lt;/P&gt;

&lt;P&gt;following is the  query i  m using FYR &lt;/P&gt;

&lt;P&gt;| inputlookup SLA.csv|table SOR_NAME SLA_THRESHOLD| join type=left SOR_NAME  [ search index=xx source=xx|rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)&lt;EM&gt;(?\d+-\d+-\d+-\d+-\d+-\d+)&lt;/EM&gt;" |where Datafeed_name!=""|rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$"  |fields SOR_NAME  time_stamp]|dedup SOR_NAME |eval time_diff = (SLA_THRESHOLD - time_stamp)|table SOR_NAME SLA_THRESHOLD time_stamp time_diff&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:58:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431494#M75510</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T22:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431495#M75511</link>
      <description>&lt;P&gt;Try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup SLA.csv 
| table SOR_NAME SLA_THRESHOLD 
| join type=left SOR_NAME 
    [ search index=xx source=xx 
    | rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)(?\d+-\d+-\d+-\d+-\d+-\d+)" 
    | where Datafeed_name!="" 
    | rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$" 
    | eval time_stamp=strptime(strftime(strptime(time_stamp,"%Y-%m-%d-%H-%M-%S") ,"%Y-%m-%d %H:%M:%S"),"%Y-%m-%d %H:%M:%S") 
    | fields SOR_NAME time_stamp] 
| dedup SOR_NAME 
| eval time_stamp = strptime(SLA_THRESHOLD,"%Y-%m-%d %H:%M:%S") 
| eval time_diff = tostring((SLA_THRESHOLD-time_stamp), "duration") 
| table SOR_NAME SLA_THRESHOLD time_stamp time_diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 12:43:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431495#M75511</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-01-29T12:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431496#M75512</link>
      <description>&lt;P&gt;no its not working ...getting the following result&lt;/P&gt;

&lt;P&gt;SOR_NAME    SLA_THRESHOLD   time_stamp  time_diff&lt;BR /&gt;
1cid    2019-01-28 20:00:00 1548727200.000000&lt;BR /&gt;&lt;BR /&gt;
1lus    2019-01-28 20:00:00 1548727200.000000    &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:00:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431496#M75512</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T23:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431497#M75513</link>
      <description>&lt;P&gt;try this previously wrongly assigned to this variable  &lt;CODE&gt;| eval SLA_THRESHOLD = strptime(SLA_THRESHOLD,"%Y-%m-%d %H:%M:%S")&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup SLA.csv 
 | table SOR_NAME SLA_THRESHOLD 
 | join type=left SOR_NAME 
     [ search index=xx source=xx 
     | rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)(?\d+-\d+-\d+-\d+-\d+-\d+)" 
     | where Datafeed_name!="" 
     | rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$" 
     | eval time_stamp=strptime(strftime(strptime(time_stamp,"%Y-%m-%d-%H-%M-%S") ,"%Y-%m-%d %H:%M:%S"),"%Y-%m-%d %H:%M:%S") 
     | fields SOR_NAME time_stamp] 
 | dedup SOR_NAME 
 | eval SLA_THRESHOLD = strptime(SLA_THRESHOLD,"%Y-%m-%d %H:%M:%S") 
 | eval time_diff = tostring((SLA_THRESHOLD-time_stamp), "duration") 
 | table SOR_NAME SLA_THRESHOLD time_stamp time_diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 13:42:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431497#M75513</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-01-29T13:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431498#M75514</link>
      <description>&lt;P&gt;no luck though...getting this &lt;/P&gt;

&lt;P&gt;SOR_NAME     SLA_THRESHOLD          time_stamp                          time_diff&lt;BR /&gt;
1cid                     1548727200.000000&lt;BR /&gt;&lt;BR /&gt;
1lus             1548727200.000000     1548729169.000000     &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431498#M75514</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T23:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431499#M75515</link>
      <description>&lt;P&gt;try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup SLA.csv 
   | table SOR_NAME SLA_THRESHOLD 
   | join type=left SOR_NAME 
       [ search index=xx source=xx 
       | rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)(?\d+-\d+-\d+-\d+-\d+-\d+)" 
       | where Datafeed_name!="" 
       | rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$" 
       | eval time_stamp = strftime(strptime(time_stamp,"%Y-%m-%d-%H-%M-%S") ,"%Y-%m-%d %H:%M:%S")
       | eval time_stamp_epoch=strptime(time_stamp,"%Y-%m-%d %H:%M:%S") 
       | fields SOR_NAME time_stamp,time_stamp_epoch] 
   | dedup SOR_NAME 
   | eval SLA_THRESHOLD_epoch = strptime(SLA_THRESHOLD,"%Y-%m-%d %H:%M:%S") 
   | eval time_diff = tostring((time_stamp_epoch-SLA_THRESHOLD_epoch), "duration") 
   | table SOR_NAME SLA_THRESHOLD time_stamp time_diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 14:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431499#M75515</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-01-29T14:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431500#M75516</link>
      <description>&lt;P&gt;the following is thw result ...not showing the difference  time&lt;/P&gt;

&lt;P&gt;SOR_NAME       SLA_THRESHOLD    time_stamp                  time_diff&lt;/P&gt;

&lt;P&gt;1lus                  2019-01-28 20:00:00   2019-01-28 20:32:49  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:00:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431500#M75516</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T23:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431501#M75517</link>
      <description>&lt;P&gt;i had modified above query, please let me know.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 15:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431501#M75517</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-01-29T15:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431502#M75518</link>
      <description>&lt;P&gt;perfect..this is working...many thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 15:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431502#M75518</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2019-01-29T15:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431503#M75519</link>
      <description>&lt;P&gt;welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 15:30:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431503#M75519</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-01-29T15:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431504#M75520</link>
      <description>&lt;P&gt;hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/156785"&gt;@vnravikumar&lt;/a&gt; ..sorry for the late question..for some reason the following query result showing some unwanted symbols in the out put&lt;/P&gt;

&lt;P&gt;updatequery:&lt;BR /&gt;
| inputlookup SLA.csv|rename SOR_TDQ_FAIL_SLA_THRESHOLD as SLA_THRESHOLD |eval SLA_THRESHOLD=if(SLA_THRESHOLD == "BUS_DT+0,21:00", "2019-01-28 20:00:00" ,SLA_THRESHOLD) |where SLA_THRESHOLD =="2019-01-28 20:00:00" |table SOR_NAME SLA_THRESHOLD| join type=left SOR_NAME  [ search index=XXX source=XXX |rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)&lt;EM&gt;(?\d+-\d+-\d+-\d+-\d+-\d+)&lt;/EM&gt;" |where Datafeed_name!=""|rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$"                                                                                                                                                                                      | eval time_stamp = strftime(strptime(time_stamp,"%Y-%m-%d-%H-%M-%S") ,"%Y-%m-%d %H:%M:%S")&lt;BR /&gt;
        | eval time_stamp_epoch=strptime(time_stamp,"%Y-%m-%d %H:%M:%S") &lt;BR /&gt;
        | fields SOR_NAME time_stamp,time_stamp_epoch] &lt;BR /&gt;
    | dedup SOR_NAME &lt;BR /&gt;
    | eval SLA_THRESHOLD_epoch = strptime(SLA_THRESHOLD,"%Y-%m-%d %H:%M:%S") &lt;BR /&gt;
    | eval time_diff = tostring((time_stamp_epoch-SLA_THRESHOLD_epoch), "duration") &lt;BR /&gt;
    | table SOR_NAME SLA_THRESHOLD time_stamp time_diff&lt;/P&gt;

&lt;P&gt;result:&lt;/P&gt;

&lt;P&gt;SOR_NAME        SLA_THRESHOLD                           time_stamp              time_diff&lt;/P&gt;

&lt;P&gt;1lus                    2019-01-28 20:00:00 2019-01-29 20:33:23 &lt;STRONG&gt;1+&lt;/STRONG&gt;00:33:23.000000&lt;/P&gt;

&lt;P&gt;the highlighted text is unexpected...can you please help me to resolve this&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:01:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431504#M75520</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T23:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate SLA with unstructured date format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431505#M75521</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;1+00:33:23.000000 it showing difference i.e &lt;CODE&gt;1 day 33 mins and 23 seconds&lt;/CODE&gt;. If you want it in a readable format then add the following statement before the table command &lt;CODE&gt;| eval time_diff=replace(time_diff,"(\d*)\+*(\d+):(\d+):(\d+)","\1 day(s) \2 hour(s) \3 minute(s) \4 sec(s)")&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup SLA.csv|rename SOR_TDQ_FAIL_SLA_THRESHOLD as SLA_THRESHOLD |eval SLA_THRESHOLD=if(SLA_THRESHOLD == "BUS_DT+0,21:00", "2019-01-28 20:00:00" ,SLA_THRESHOLD) |where SLA_THRESHOLD =="2019-01-28 20:00:00" |table SOR_NAME SLA_THRESHOLD| join type=left SOR_NAME [ search index=XXX source=XXX |rex "info\s:\s+{4}\s(?\w+)\s+{4}\sJob run_ingest_(?\w+)(?\d+-\d+-\d+-\d+-\d+-\d+)" |where Datafeed_name!=""|rex field=Datafeed_name "^(?\w{2,5})_(?\w+)$" | eval time_stamp = strftime(strptime(time_stamp,"%Y-%m-%d-%H-%M-%S") ,"%Y-%m-%d %H:%M:%S")
| eval time_stamp_epoch=strptime(time_stamp,"%Y-%m-%d %H:%M:%S") 
| fields SOR_NAME time_stamp,time_stamp_epoch] 
| dedup SOR_NAME 
| eval SLA_THRESHOLD_epoch = strptime(SLA_THRESHOLD,"%Y-%m-%d %H:%M:%S") 
| eval time_diff = tostring((time_stamp_epoch-SLA_THRESHOLD_epoch), "duration") | eval time_diff=replace(time_diff,"(\d*)\+*(\d+):(\d+):(\d+)\.(.*)","\1 day(s) \2 hour(s) \3 minute(s) \4 sec(s)")
| table SOR_NAME SLA_THRESHOLD time_stamp time_diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jan 2019 14:30:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-calculate-SLA-with-unstructured-date-format/m-p/431505#M75521</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-01-30T14:30:26Z</dc:date>
    </item>
  </channel>
</rss>

