<?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 enumerate the events in my search results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-enumerate-the-events-in-my-search-results/m-p/169546#M48463</link>
    <description>&lt;P&gt;You can use the accum command to simulate this sort of effect.&lt;/P&gt;

&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;
| eval n = 1 | accum n 
&lt;/PRE&gt;

&lt;P&gt;which will create a new field called "n" that will contain the incremental event number in the order of your search results.&lt;/P&gt;

&lt;P&gt;you can then list out the events and this line number in a table like this:&lt;/P&gt;

&lt;PRE&gt;
| table n _raw
&lt;/PRE&gt;

&lt;P&gt;Also, if you want to list it out like you would see in a text editor, where the earliest event is at the top, and the latest event is at the bottom, then use the reverse command first, like this:&lt;/P&gt;

&lt;PRE&gt;
| reverse | eval n = 1 | accum n | table n _raw
&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 Aug 2014 15:11:29 GMT</pubDate>
    <dc:creator>maverick</dc:creator>
    <dc:date>2014-08-04T15:11:29Z</dc:date>
    <item>
      <title>How to enumerate the events in my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enumerate-the-events-in-my-search-results/m-p/169545#M48462</link>
      <description>&lt;P&gt;When I view my log file in my favorite text editor(s), I can switch to a mode where the editor lists out the line numbers long the side.&lt;/P&gt;

&lt;P&gt;After I search my events in Splunk, is there a similar way to enumerate the events so that I get a line number next to each event?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2014 15:05:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enumerate-the-events-in-my-search-results/m-p/169545#M48462</guid>
      <dc:creator>maverick</dc:creator>
      <dc:date>2014-08-04T15:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to enumerate the events in my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enumerate-the-events-in-my-search-results/m-p/169546#M48463</link>
      <description>&lt;P&gt;You can use the accum command to simulate this sort of effect.&lt;/P&gt;

&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;
| eval n = 1 | accum n 
&lt;/PRE&gt;

&lt;P&gt;which will create a new field called "n" that will contain the incremental event number in the order of your search results.&lt;/P&gt;

&lt;P&gt;you can then list out the events and this line number in a table like this:&lt;/P&gt;

&lt;PRE&gt;
| table n _raw
&lt;/PRE&gt;

&lt;P&gt;Also, if you want to list it out like you would see in a text editor, where the earliest event is at the top, and the latest event is at the bottom, then use the reverse command first, like this:&lt;/P&gt;

&lt;PRE&gt;
| reverse | eval n = 1 | accum n | table n _raw
&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Aug 2014 15:11:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enumerate-the-events-in-my-search-results/m-p/169546#M48463</guid>
      <dc:creator>maverick</dc:creator>
      <dc:date>2014-08-04T15:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to enumerate the events in my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-enumerate-the-events-in-my-search-results/m-p/169547#M48464</link>
      <description>&lt;P&gt;Also, there is an internal field called &lt;CODE&gt;_serial&lt;/CODE&gt; that should already be there (but it is semi-invisible) but it starts at &lt;CODE&gt;0&lt;/CODE&gt; instead of &lt;CODE&gt;1&lt;/CODE&gt;.   Try this (should be the quickest and most efficient solution):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval serial=_serial | table serial _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Sep 2015 15:04:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-enumerate-the-events-in-my-search-results/m-p/169547#M48464</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-09-17T15:04:49Z</dc:date>
    </item>
  </channel>
</rss>

