<?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 How to display ONLY first row for each value in table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-ONLY-first-row-for-each-value-in-table/m-p/211051#M61718</link>
    <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I have a requirement to use display first row for every ACCNO.any Ideas?&lt;/P&gt;

&lt;P&gt;query:&lt;BR /&gt;
I used some transaction command |table ACCNO,VALUE&lt;/P&gt;

&lt;P&gt;ACCNO   VALUE&lt;BR /&gt;
1       100&lt;BR /&gt;
1       110&lt;BR /&gt;
2       125&lt;BR /&gt;
2       134&lt;BR /&gt;
2       143&lt;BR /&gt;
3       156&lt;BR /&gt;
3       123&lt;BR /&gt;
4       124&lt;BR /&gt;
5       567&lt;BR /&gt;
5    129 &lt;BR /&gt;
5       345&lt;/P&gt;

&lt;P&gt;EXPECTED OUTPUT:&lt;/P&gt;

&lt;P&gt;ACCNO   VALUE&lt;BR /&gt;
1       100&lt;BR /&gt;
2       125&lt;BR /&gt;
3       156&lt;BR /&gt;
4       124&lt;BR /&gt;
5       567&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2016 18:09:39 GMT</pubDate>
    <dc:creator>mprreddy51</dc:creator>
    <dc:date>2016-08-03T18:09:39Z</dc:date>
    <item>
      <title>How to display ONLY first row for each value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-ONLY-first-row-for-each-value-in-table/m-p/211051#M61718</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I have a requirement to use display first row for every ACCNO.any Ideas?&lt;/P&gt;

&lt;P&gt;query:&lt;BR /&gt;
I used some transaction command |table ACCNO,VALUE&lt;/P&gt;

&lt;P&gt;ACCNO   VALUE&lt;BR /&gt;
1       100&lt;BR /&gt;
1       110&lt;BR /&gt;
2       125&lt;BR /&gt;
2       134&lt;BR /&gt;
2       143&lt;BR /&gt;
3       156&lt;BR /&gt;
3       123&lt;BR /&gt;
4       124&lt;BR /&gt;
5       567&lt;BR /&gt;
5    129 &lt;BR /&gt;
5       345&lt;/P&gt;

&lt;P&gt;EXPECTED OUTPUT:&lt;/P&gt;

&lt;P&gt;ACCNO   VALUE&lt;BR /&gt;
1       100&lt;BR /&gt;
2       125&lt;BR /&gt;
3       156&lt;BR /&gt;
4       124&lt;BR /&gt;
5       567&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2016 18:09:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-ONLY-first-row-for-each-value-in-table/m-p/211051#M61718</guid>
      <dc:creator>mprreddy51</dc:creator>
      <dc:date>2016-08-03T18:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to display ONLY first row for each value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-ONLY-first-row-for-each-value-in-table/m-p/211052#M61719</link>
      <description>&lt;P&gt;Try any of these&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; some transaction command |table ACCNO,VALUE | dedup ACCNO

 some transaction command |table ACCNO,VALUE | stats first(VALUE) as VALUE by ACCNO
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Aug 2016 18:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-ONLY-first-row-for-each-value-in-table/m-p/211052#M61719</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-03T18:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to display ONLY first row for each value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-ONLY-first-row-for-each-value-in-table/m-p/211053#M61720</link>
      <description>&lt;P&gt;@somesoni2&lt;/P&gt;

&lt;P&gt;Hi Somesh,&lt;/P&gt;

&lt;P&gt;can we use first(duration) or last(duration) in timechart command?I want to pick only first value in duration&lt;/P&gt;

&lt;P&gt;like sampledata:&lt;/P&gt;

&lt;P&gt;_time                                   duration&lt;BR /&gt;
2016-08-02 12:00:00        11.848000&lt;BR /&gt;
                                               12.031000&lt;BR /&gt;
query:&lt;BR /&gt;
transaction command|  timechart span=1m list(duration) as duration&lt;/P&gt;

&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2016 20:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-ONLY-first-row-for-each-value-in-table/m-p/211053#M61720</guid>
      <dc:creator>mprreddy51</dc:creator>
      <dc:date>2016-08-03T20:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to display ONLY first row for each value in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-ONLY-first-row-for-each-value-in-table/m-p/211054#M61721</link>
      <description>&lt;P&gt;You're using list function with timechart, so you'd be getting a multivalued field duration for minutes where there is multiple duration. This list will be sorted by the time. So if you want to pick up only a single value, first or last, from this multivalued list, try like this for getting first/oldest duration for that min&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;transaction command| timechart span=1m list(duration) as duration | eval duration=mvindex(duration,0) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Replace&lt;CODE&gt;| eval duration=mvindex(duration,0)&lt;/CODE&gt; with &lt;CODE&gt;| eval duration=mvindex(duration,-1)&lt;/CODE&gt; for last/latest duration for that min&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2016 21:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-ONLY-first-row-for-each-value-in-table/m-p/211054#M61721</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-03T21:06:11Z</dc:date>
    </item>
  </channel>
</rss>

