<?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: List files in search then table the duration between beginning and end of processing in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160857#M45493</link>
    <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=server earliest=7/31/2015:00:00:00 latest=7/31/2015:23:59:59 ("Starting" OR "Finished") | rex "(?&amp;lt;inputfile&amp;gt;\w*.zip)" | transaction maxevents=2 inputfile | table inputfile duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 05 Aug 2015 20:50:40 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2015-08-05T20:50:40Z</dc:date>
    <item>
      <title>List files in search then table the duration between beginning and end of processing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160850#M45486</link>
      <description>&lt;P&gt;I'm trying to limit the scope of a search to a 24 hour window and list all of the files analyzed within that period but then display a table of how long it took to finish processing each file. &lt;/P&gt;

&lt;P&gt;For example, I have:&lt;/P&gt;

&lt;P&gt;2015-07-31 15:56:13.7599|DEBUG|FileAnalyzer|Finished file.zip&lt;BR /&gt;
2015-07-31 15:56:13.0099|DEBUG|FileAnalyzer|Starting file.zip&lt;/P&gt;

&lt;P&gt;I can get something as simple as:&lt;/P&gt;

&lt;P&gt;host=server earliest=7/31/2015:00:00:00 latest=7/31/2015:23:59:59 ("Starting" OR "Finished") | rex "(?&amp;lt;inputfile&amp;gt;\w*.zip)" | stats count by inputfile&lt;/P&gt;

&lt;P&gt;But that's a simple count. I'm looking for a table that will resemble something like:&lt;/P&gt;

&lt;P&gt;INPUTFILE | DURATION&lt;BR /&gt;
file.zip        | 3.067&lt;/P&gt;

&lt;P&gt;I've tried a combination of map, transaction, and table with and without subsearches without being successful. Any help would be most appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 21:11:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160850#M45486</guid>
      <dc:creator>jamieivanov</dc:creator>
      <dc:date>2015-08-04T21:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: List files in search then table the duration between beginning and end of processing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160851#M45487</link>
      <description>&lt;P&gt;Run this search for "last  24 hours":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex "\|(?&amp;lt;Stage&amp;gt;\w+)\s+(?&amp;lt;inputfile&amp;gt;\w*.zip)" | eval StartTime=if(Stage="Starting", _time, null()) | eval EndTime=if(Stage="Finished", _time, null()) | stats earliest(StartTime) AS StartTime latest(EndTime) AS EndTime by inputfile | eval Duration = EndTime - StartTime | table inputfile Duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2015 22:03:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160851#M45487</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-04T22:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: List files in search then table the duration between beginning and end of processing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160852#M45488</link>
      <description>&lt;P&gt;That looks to be a brilliant solution! However, the main search brings up 14 results of starting/finished log entry pairs which would be 7 files but I'm getting 6 results with one of them &amp;gt;1,000 seconds (for duration). The one file that is &amp;gt;1,000 seconds shows up twice in the search results but both instances are &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt; seconds. I think what's happening is that the start time if the first instance is being matched with the end time of the last instance; would I be able to call upon your perspicacity for thoughts on this?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 13:33:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160852#M45488</guid>
      <dc:creator>jamieivanov</dc:creator>
      <dc:date>2015-08-05T13:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: List files in search then table the duration between beginning and end of processing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160853#M45489</link>
      <description>&lt;P&gt;My solution presumes that you are &lt;CODE&gt;timestamping&lt;/CODE&gt; your events correctly and that each event's &lt;CODE&gt;_time&lt;/CODE&gt; value is the same as the first PSV value in each row.  Is this the case?  It also presumes that each file is only processed once and I think that is where the breakdown is.  Is it possible for a file to be processed more than once?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 20:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160853#M45489</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-05T20:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: List files in search then table the duration between beginning and end of processing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160854#M45490</link>
      <description>&lt;P&gt;Assuming that a file can be processed more than once, then this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | rex "\|(?&amp;lt;Stage&amp;gt;\w+)\s+(?&amp;lt;inputfile&amp;gt;\w*.zip)" | eval StartTime=if(Stage="Starting", _time, null()) | eval EndTime=if(Stage="Finished", _time, null()) | streamstats last(EndTime) AS EndTime by inputfile | where Stage="Starting" | eval Duration = EndTime - _time| table inputfile Duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Aug 2015 20:20:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160854#M45490</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-05T20:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: List files in search then table the duration between beginning and end of processing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160855#M45491</link>
      <description>&lt;P&gt;The timestamps should be handled correctly but I'm afraid I don't understand the second part of that sentence. Under ideal circumstances, the assumption that a file would be used only once would be accurate but during testing it is possible that a file may be processed more than once.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 20:27:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160855#M45491</guid>
      <dc:creator>jamieivanov</dc:creator>
      <dc:date>2015-08-05T20:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: List files in search then table the duration between beginning and end of processing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160856#M45492</link>
      <description>&lt;P&gt;Streamstats still has the same issue but also introduced multiple instances of the input file name without a duration.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 20:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160856#M45492</guid>
      <dc:creator>jamieivanov</dc:creator>
      <dc:date>2015-08-05T20:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: List files in search then table the duration between beginning and end of processing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160857#M45493</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=server earliest=7/31/2015:00:00:00 latest=7/31/2015:23:59:59 ("Starting" OR "Finished") | rex "(?&amp;lt;inputfile&amp;gt;\w*.zip)" | transaction maxevents=2 inputfile | table inputfile duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Aug 2015 20:50:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160857#M45493</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-05T20:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: List files in search then table the duration between beginning and end of processing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160858#M45494</link>
      <description>&lt;P&gt;I appreciate your suggestion and it looks like that is working exactly as I had expected. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 21:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-files-in-search-then-table-the-duration-between-beginning/m-p/160858#M45494</guid>
      <dc:creator>jamieivanov</dc:creator>
      <dc:date>2015-08-05T21:06:39Z</dc:date>
    </item>
  </channel>
</rss>

