<?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 add time values together in search query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349761#M163230</link>
    <description>&lt;P&gt;Here you go &lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval current="10:00:00" &lt;BR /&gt;
| eval c_time=strptime(current,"%H:%M:%S") &lt;BR /&gt;
| eval duration=30 &lt;BR /&gt;
| eval total = c_time+duration &lt;BR /&gt;
| convert ctime(total)&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:55:52 GMT</pubDate>
    <dc:creator>ssadanala1</dc:creator>
    <dc:date>2020-09-29T17:55:52Z</dc:date>
    <item>
      <title>How to add time values together in search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349757#M163226</link>
      <description>&lt;P&gt;Basically just trying to add three time values together by doing this: &lt;CODE&gt;eval total_time = queue_time + Duration + test_summary.duration&lt;/CODE&gt;, but I am not getting any results. Any help?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 14:05:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349757#M163226</guid>
      <dc:creator>cdgill</dc:creator>
      <dc:date>2018-01-30T14:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time values together in search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349758#M163227</link>
      <description>&lt;P&gt;Hi @cdgill,&lt;/P&gt;

&lt;P&gt;Can you please provide sample data for all three fields ?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 15:50:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349758#M163227</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-01-30T15:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time values together in search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349759#M163228</link>
      <description>&lt;P&gt;@cdgill, make sure that the three field names are correct and have same case as field names are case sensitive i.e. &lt;CODE&gt;queue_time&lt;/CODE&gt;, &lt;CODE&gt;Duration&lt;/CODE&gt; and &lt;CODE&gt;test_summary.duration&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Since dot &lt;CODE&gt;(.)&lt;/CODE&gt; is used as string concatenation character for eval, you would need to escape the dot character present in the field name using &lt;CODE&gt;single quotes in eval expression&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearchWithThreeFields&amp;gt;
| eval total_time = queue_time + Duration + 'test_summary.duration'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere example for the same:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval queue_time=5, Duration=4, test_summary.duration=7
| table queue_time Duration "test_summary.duration"
| eval total_time = queue_time + Duration + 'test_summary.duration'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jan 2018 16:19:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349759#M163228</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-01-30T16:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time values together in search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349760#M163229</link>
      <description>&lt;P&gt;Just attempted your solution and it seemed to just perform a string concatenation. &lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 18:45:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349760#M163229</guid>
      <dc:creator>cdgill</dc:creator>
      <dc:date>2018-01-30T18:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time values together in search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349761#M163230</link>
      <description>&lt;P&gt;Here you go &lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval current="10:00:00" &lt;BR /&gt;
| eval c_time=strptime(current,"%H:%M:%S") &lt;BR /&gt;
| eval duration=30 &lt;BR /&gt;
| eval total = c_time+duration &lt;BR /&gt;
| convert ctime(total)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:55:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349761#M163230</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2020-09-29T17:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time values together in search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349762#M163231</link>
      <description>&lt;P&gt;@cdgill, have you tried the run anywhere search above? Are you not getting the total_time as 16?&lt;/P&gt;

&lt;P&gt;If run anywhere search is working and &lt;CODE&gt;| eval total_time = queue_time + Duration + 'test_summary.duration'&lt;/CODE&gt; is not working in your current search please add some sample data for the three fields and also mention the field names as is.&lt;/P&gt;

&lt;P&gt;What happens when you print &lt;CODE&gt;| table queue_time Duration "test_summary.duration"&lt;/CODE&gt;. Are the fields showing values correctly?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 20:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349762#M163231</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-01-30T20:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time values together in search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349763#M163232</link>
      <description>&lt;P&gt;Here's an image which shows my table along with my search query. I appreciate the help, I'm very new and lost when it comes to Splunk! &lt;A href="https://imgur.com/a/FfM0Q"&gt;https://imgur.com/a/FfM0Q&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 20:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349763#M163232</guid>
      <dc:creator>cdgill</dc:creator>
      <dc:date>2018-01-30T20:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time values together in search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349764#M163233</link>
      <description>&lt;P&gt;@cdgill you need to convert the duration to epoch and later change it to human readable format&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 20:11:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-time-values-together-in-search-query/m-p/349764#M163233</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2018-01-30T20:11:18Z</dc:date>
    </item>
  </channel>
</rss>

