<?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 Splunk Search to get time if exceeds cut off time on account of day changed? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647318#M224043</link>
    <description>&lt;P&gt;Hai All,&lt;/P&gt;&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;we have event in splunk for job_name Test job HAS&amp;nbsp; START_TIME&amp;nbsp; at&amp;nbsp;2023/06/15 23:30:33 and&amp;nbsp;END_TIME&amp;nbsp;2023/06/16 00:04:09&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;AND we have static cut off time for each job which we have added in lookup data&lt;/P&gt;&lt;P&gt;FOR ABOVE job cutoff time is 23:40 but the job crossed cutoff time even day was changes&lt;BR /&gt;&lt;BR /&gt;BELOW is the query i was using to get if any job exceed cutoff time on account of day changes it should consider the same day&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;this query not giving expected ouput,please help on it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2023 12:46:27 GMT</pubDate>
    <dc:creator>sekhar463</dc:creator>
    <dc:date>2023-10-19T12:46:27Z</dc:date>
    <item>
      <title>Splunk Search to get time if exceeds cut off time on account of day changed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647318#M224043</link>
      <description>&lt;P&gt;Hai All,&lt;/P&gt;&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;we have event in splunk for job_name Test job HAS&amp;nbsp; START_TIME&amp;nbsp; at&amp;nbsp;2023/06/15 23:30:33 and&amp;nbsp;END_TIME&amp;nbsp;2023/06/16 00:04:09&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;AND we have static cut off time for each job which we have added in lookup data&lt;/P&gt;&lt;P&gt;FOR ABOVE job cutoff time is 23:40 but the job crossed cutoff time even day was changes&lt;BR /&gt;&lt;BR /&gt;BELOW is the query i was using to get if any job exceed cutoff time on account of day changes it should consider the same day&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;this query not giving expected ouput,please help on it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 12:46:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647318#M224043</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-10-19T12:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK SEARCH TO GET TIME IF EXCEED IF DAY CHANGED</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647345#M224054</link>
      <description>&lt;P&gt;I get the feeling that in your use case, it is not worth thinking in calendar time. &amp;nbsp;Instead, just convert everything to epoch for calculation.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test sourcetype=test_source
| lookup Autosys_crd.csv JOB_NAME OUTPUT KB REGION CUTOFF_CST
| eval Last_Job_start = strptime(LAST_START, "%Y/%m/%d %H:%M:%S")
| eval Last_Job_end = strptime(LAST_END, "%Y/%m/%d %H:%M:%S")
| eval Job_start_date = strptime(replace(LAST_START, " [\d:]+", ""))
| eval Cutoff_Time = Job_start_date + strptime(CUTOFF_CST, "%H:%M")
| eval Exceeded_Cutoff = if(STATUS="ACTIVATED","",if(Last_Job_end &amp;gt; Cutoff_Time, 1, 0))
| stats count(eval(Exceeded_Cutoff == 1)) as Exceeded_Count&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 16 Jun 2023 17:29:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647345#M224054</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-06-16T17:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK SEARCH TO GET TIME IF EXCEED IF DAY CHANGED</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647467#M224095</link>
      <description>&lt;P&gt;Not giving results one job exceeded cutoff time for below&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;we have event in splunk for job_name Test job HAS&amp;nbsp; START_TIME&amp;nbsp; at&amp;nbsp;2023/06/15 23:30:33 and&lt;BR /&gt;&amp;nbsp;END_TIME&amp;nbsp;2023/06/16 00:04:09&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;cutoff time is 23:40&lt;BR /&gt;&lt;BR /&gt;but when i was searching its not showing this,its not taking due to day change with END_TIME&lt;/P&gt;&lt;P&gt;how can i overcome this to check if any exceeded on the day even it was changed the day&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 09:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647467#M224095</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-06-19T09:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK SEARCH TO GET TIME IF EXCEED IF DAY CHANGED</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647468#M224096</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test sourcetype=test_source
| lookup Autosys_crd.csv JOB_NAME OUTPUT KB REGION CUTOFF_CST
| eval Last_Job_start = strptime(LAST_START, "%Y/%m/%d %H:%M:%S")
| eval Last_Job_end = strptime(LAST_END, "%Y/%m/%d %H:%M:%S")
| eval Cutoff_Time = strptime(replace(LAST_START, " [\d:]+", "")." ".CUTOFF_CST, "%Y/%m/%d %H:%M")
| eval Exceeded_Cutoff = if(STATUS="ACTIVATED","",if(Last_Job_end &amp;gt; Cutoff_Time, 1, 0))
| stats count(eval(Exceeded_Cutoff == 1)) as Exceeded_Count&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 19 Jun 2023 09:31:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647468#M224096</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-19T09:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK SEARCH TO GET TIME IF EXCEED IF DAY CHANGED</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647546#M224126</link>
      <description>&lt;P&gt;Two problems with the previous one. &amp;nbsp;First, strptime cannot operate without a date string. &amp;nbsp;But the second is more important: Cutoff_Time was only populated in events that contain LAST_START, but it needs to be compared with LAST_END. &amp;nbsp;It has to be cross populated, by JOB_NAME.&lt;/P&gt;&lt;P&gt;So, if I assume that by START_TIME you mean LAST_START, by END_TIME you mean LAST_END, the following should give desired results&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test sourcetype=test_source
| lookup Autosys_crd.csv JOB_NAME OUTPUT KB REGION CUTOFF_CST
| eval Last_Job_start = strptime(LAST_START, "%Y/%m/%d %H:%M:%S")
| eval Last_Job_end = strptime(LAST_END, "%Y/%m/%d %H:%M:%S")
| eval Job_start_date = replace(LAST_START, " [\d:]+", "")
| eval Cutoff_Time = strptime(Job_start_date . " " . CUTOFF_CST, "%Y/%m/%d %H:%M")
| stats max(Cutoff_Time) as Cutoff_Time max(Last_Job_*) as Last_Job_* by JOB_NAME
| eval Exceeded_Cutoff = if(STATUS="ACTIVATED","",if(Last_Job_end &amp;gt; Cutoff_Time, 1, 0))
| stats count(eval(Exceeded_Cutoff == 1)) as Exceeded_Count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 06:38:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Search-to-get-time-if-exceeds-cut-off-time-on-account-of/m-p/647546#M224126</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-06-20T06:38:34Z</dc:date>
    </item>
  </channel>
</rss>

