<?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 get results only from the last source file? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242096#M46936</link>
    <description>&lt;P&gt;Yes!! In my case I have solved with head comand:&lt;/P&gt;

&lt;P&gt;index=index1 source="file.csv" Status="Active" [search index=index1 source="file.csv" | dedup _time | head 1 | return _time] |...&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2017 12:33:55 GMT</pubDate>
    <dc:creator>jul1an</dc:creator>
    <dc:date>2017-11-14T12:33:55Z</dc:date>
    <item>
      <title>How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242085#M46925</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I got an index which continuously receive new source file automatically, what I want is to my search to only return events from the last source file. Should be something simple but I did not figure it out, maybe with the |head command.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 15:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242085#M46925</guid>
      <dc:creator>bruno_eduardo</dc:creator>
      <dc:date>2015-11-20T15:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242086#M46926</link>
      <description>&lt;P&gt;Like this (replace &lt;CODE&gt;...&lt;/CODE&gt; with the exact same base search; yes, twice):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... [ ... | stats latest(source) AS source ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Nov 2015 15:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242086#M46926</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-20T15:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242087#M46927</link>
      <description>&lt;P&gt;Thanks!!!!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 15:44:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242087#M46927</guid>
      <dc:creator>bruno_eduardo</dc:creator>
      <dc:date>2015-11-20T15:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242088#M46928</link>
      <description>&lt;P&gt;What about the Before Last?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 15:56:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242088#M46928</guid>
      <dc:creator>bruno_eduardo</dc:creator>
      <dc:date>2015-11-20T15:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242089#M46929</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... NOT [ ... | stats latest(source) AS source ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Nov 2015 16:07:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242089#M46929</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-20T16:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242090#M46930</link>
      <description>&lt;P&gt;But I mean before last source file only&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 16:34:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242090#M46930</guid>
      <dc:creator>bruno_eduardo</dc:creator>
      <dc:date>2015-11-20T16:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242091#M46931</link>
      <description>&lt;P&gt;Did you try it?  That's what it does.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 16:52:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242091#M46931</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-20T16:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242092#M46932</link>
      <description>&lt;P&gt;Yes I tried, I have 20 source files for this index and when I do this I got 19, every each of them except the last one. What I need is only the 19th one. I already got the 20th with your answer, just need the before last.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 17:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242092#M46932</guid>
      <dc:creator>bruno_eduardo</dc:creator>
      <dc:date>2015-11-20T17:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242093#M46933</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... [ ... | dedup source | reverse | list(source) AS source| eval source=mvindex(source,1) ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then adjust the &lt;CODE&gt;1&lt;/CODE&gt; to whichever one you would like.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2015 02:02:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242093#M46933</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-21T02:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242094#M46934</link>
      <description>&lt;P&gt;That is really great but don't solve the problem, This search would only help if I had a fixed number of source files, the problems is: The index continuously receive new source file automatically, so I would need to change the search every time.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 14:48:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242094#M46934</guid>
      <dc:creator>bruno_eduardo</dc:creator>
      <dc:date>2015-11-23T14:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242095#M46935</link>
      <description>&lt;P&gt;Sorry it worked, without the |reverse, look:&lt;/P&gt;

&lt;P&gt;index="myindex" [search index="myindex" | dedup source |stats list(source) AS source| eval source=mvindex(source,2) ]&lt;/P&gt;

&lt;P&gt;this bring myu before last source file events.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 14:57:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242095#M46935</guid>
      <dc:creator>bruno_eduardo</dc:creator>
      <dc:date>2015-11-23T14:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get results only from the last source file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242096#M46936</link>
      <description>&lt;P&gt;Yes!! In my case I have solved with head comand:&lt;/P&gt;

&lt;P&gt;index=index1 source="file.csv" Status="Active" [search index=index1 source="file.csv" | dedup _time | head 1 | return _time] |...&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 12:33:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-results-only-from-the-last-source-file/m-p/242096#M46936</guid>
      <dc:creator>jul1an</dc:creator>
      <dc:date>2017-11-14T12:33:55Z</dc:date>
    </item>
  </channel>
</rss>

