<?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 to splunk search to get time only from date time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622807#M216536</link>
    <description>&lt;P&gt;HI &lt;A class="" href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352" target="_self"&gt;&lt;SPAN class=""&gt;gcusello&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am using below query to calculate if job started on time or not based on actual start time and job start time, the eval condition is not working as i am comparing the time with actual_start time with job start by time&lt;/P&gt;&lt;P&gt;please help if job not started time not matching with actual time then it result is late&lt;/P&gt;&lt;P&gt;and start time is equal to actual start time is the result will be on_time&lt;/P&gt;&lt;P&gt;so how can i create these 2 fields based on these&lt;/P&gt;&lt;P&gt;index=main sourcetype=TEST&lt;BR /&gt;| eval Job_start_by=strftime(strptime(START_TIME,"%Y/%m/%d %H:%M:%S"),"%H:%M")&lt;BR /&gt;| eval SLA=IF(Job_start_by="ACTUAL_START_TIME","1.ON-TIME",IF(Job_start_by&amp;gt;"ACTUAL_START_TIME","2.LATE")&lt;BR /&gt;| table JOB_NAME,STATUS,START_TIME,END_TIME,DAYS_OF_WEEK,ACTUAL_START_TIME,RUNTIME,Job_start_by&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2023 13:17:32 GMT</pubDate>
    <dc:creator>sekhar463</dc:creator>
    <dc:date>2023-10-19T13:17:32Z</dc:date>
    <item>
      <title>How to splunk search to get time only from date time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622605#M216450</link>
      <description>&lt;P&gt;hi All,&lt;/P&gt;&lt;P&gt;can you help with splunk search to get time only from date time.&lt;/P&gt;&lt;P&gt;example as 2022/11/28 17:00:00 want to get only time 17:00&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 13:01:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622605#M216450</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-10-19T13:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search to get time only from date time.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622608#M216453</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244375"&gt;@sekhar463&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to use the eval command with the strftime funtion, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval NEW_START_TIME=strftime(START_TIME,"%H:$M")&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 12:01:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622608#M216453</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-30T12:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search to get time only from date time.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622623#M216462</link>
      <description>&lt;P&gt;hai Thanks for your response.&lt;/P&gt;&lt;P&gt;i am using below query but not getting field values for NEW_START_TIME&lt;/P&gt;&lt;P&gt;index=main sourcetype=autosys_CRD&lt;BR /&gt;|eval NEW_START_TIME=strftime(START_TIME,"%H:$M")&lt;BR /&gt;| table JOB_NAME,STATUS,START_TIME,END_TIME,DAYS_OF_WEEK,ACTUAL_START_TIME,RUNTIME,NEW_START_TIME&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 13:10:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622623#M216462</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2022-11-30T13:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search to get time only from date time.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622627#M216466</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244375"&gt;@sekhar463&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sorry I did a mistyping, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main sourcetype=autosys_CRD
|eval NEW_START_TIME=strftime(START_TIME,"%H:%M")
| table JOB_NAME,STATUS,START_TIME,END_TIME,DAYS_OF_WEEK,ACTUAL_START_TIME,RUNTIME,NEW_START_TIME&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 13:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622627#M216466</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-30T13:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search to get time only from date time.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622629#M216468</link>
      <description>&lt;P&gt;still the same empty values for the field values&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 13:19:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622629#M216468</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2022-11-30T13:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search to get time only from date time.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622632#M216469</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244375"&gt;@sekhar463&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sorry ! I forgot that you START_TIME isn't in epochtime,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main sourcetype=autosys_CRD
| eval NEW_START_TIME=strftime(strptime(START_TIME,"%Y/%m/%d %H:%M:%S"),"%H:%M")
| table JOB_NAME,STATUS,START_TIME,END_TIME,DAYS_OF_WEEK,ACTUAL_START_TIME,RUNTIME,NEW_START_TIME&lt;/LI-CODE&gt;&lt;P&gt;you could also try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main sourcetype=autosys_CRD
| eval NEW_START_TIME=substr(START_TIME,10,5)
| table JOB_NAME,STATUS,START_TIME,END_TIME,DAYS_OF_WEEK,ACTUAL_START_TIME,RUNTIME,NEW_START_TIME&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 13:24:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622632#M216469</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-30T13:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to splunk search to get time only from date time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622641#M216470</link>
      <description>&lt;P&gt;Hi I am trying to calculate SLA breach based on the below job START_TIME and END_TIME&lt;/P&gt;&lt;P&gt;need help on search query to get below scenario.&lt;/P&gt;&lt;P&gt;in below job actual start time was 4:30 but it was started at 4:50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 13:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622641#M216470</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-10-19T13:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to splunk search to get time only from date time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622807#M216536</link>
      <description>&lt;P&gt;HI &lt;A class="" href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352" target="_self"&gt;&lt;SPAN class=""&gt;gcusello&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am using below query to calculate if job started on time or not based on actual start time and job start time, the eval condition is not working as i am comparing the time with actual_start time with job start by time&lt;/P&gt;&lt;P&gt;please help if job not started time not matching with actual time then it result is late&lt;/P&gt;&lt;P&gt;and start time is equal to actual start time is the result will be on_time&lt;/P&gt;&lt;P&gt;so how can i create these 2 fields based on these&lt;/P&gt;&lt;P&gt;index=main sourcetype=TEST&lt;BR /&gt;| eval Job_start_by=strftime(strptime(START_TIME,"%Y/%m/%d %H:%M:%S"),"%H:%M")&lt;BR /&gt;| eval SLA=IF(Job_start_by="ACTUAL_START_TIME","1.ON-TIME",IF(Job_start_by&amp;gt;"ACTUAL_START_TIME","2.LATE")&lt;BR /&gt;| table JOB_NAME,STATUS,START_TIME,END_TIME,DAYS_OF_WEEK,ACTUAL_START_TIME,RUNTIME,Job_start_by&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 13:17:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-splunk-search-to-get-time-only-from-date-time/m-p/622807#M216536</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-10-19T13:17:32Z</dc:date>
    </item>
  </channel>
</rss>

