<?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: Eval difference between two fields for each entry in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-difference-between-two-fields-for-each-entry/m-p/181283#M52268</link>
    <description>&lt;P&gt;Thanks, that got me there.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
|dbinspect index=main&lt;BR /&gt;
| eval span=tostring((endEpoch-startEpoch), "duration") | eval start_time=strftime(startEpoch,"%y/%m/%dT%H:%M:%S") | eval end_time=strftime(endEpoch,"%y/%m/%dT%H:%M:%S")&lt;BR /&gt;
| table start_time,end_time,span,modTime,state,sizeOnDiskMB,rawSize,eventCount,sourceCount,sourceTypeCount,splunk_server,path&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 07:02:33 GMT</pubDate>
    <dc:creator>ltrand</dc:creator>
    <dc:date>2020-09-29T07:02:33Z</dc:date>
    <item>
      <title>Eval difference between two fields for each entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-difference-between-two-fields-for-each-entry/m-p/181281#M52266</link>
      <description>&lt;P&gt;So I'm trying to display what the timespan is from start to finish of a bucket and add it as a new field to the table.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|dbinspect index=main
| eval start_time=strftime(startEpoch,"%y/%m/%dT%H:%M:%S") | eval end_time=strftime(endEpoch,"%y/%m/%dT%H:%M:%S") | eval span=tostring((end_time-start_time), "duration")
| table start_time,end_time,span,modTime,state,sizeOnDiskMB,rawSize,eventCount,sourceCount,sourceTypeCount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is that the eval statement that is supposed to calculate span is not functioning correctly, it is just empty for each line.  Any thoughts on how I can fix this?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2015 17:49:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-difference-between-two-fields-for-each-entry/m-p/181281#M52266</guid>
      <dc:creator>ltrand</dc:creator>
      <dc:date>2015-08-19T17:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Eval difference between two fields for each entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-difference-between-two-fields-for-each-entry/m-p/181282#M52267</link>
      <description>&lt;P&gt;Subtract times using epochs rather than strings.  Then convert it into a human-readable format, if desired.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval span=endEpoch-startEpoch | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Aug 2015 17:55:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-difference-between-two-fields-for-each-entry/m-p/181282#M52267</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-19T17:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Eval difference between two fields for each entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-difference-between-two-fields-for-each-entry/m-p/181283#M52268</link>
      <description>&lt;P&gt;Thanks, that got me there.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
|dbinspect index=main&lt;BR /&gt;
| eval span=tostring((endEpoch-startEpoch), "duration") | eval start_time=strftime(startEpoch,"%y/%m/%dT%H:%M:%S") | eval end_time=strftime(endEpoch,"%y/%m/%dT%H:%M:%S")&lt;BR /&gt;
| table start_time,end_time,span,modTime,state,sizeOnDiskMB,rawSize,eventCount,sourceCount,sourceTypeCount,splunk_server,path&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:02:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-difference-between-two-fields-for-each-entry/m-p/181283#M52268</guid>
      <dc:creator>ltrand</dc:creator>
      <dc:date>2020-09-29T07:02:33Z</dc:date>
    </item>
  </channel>
</rss>

