<?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: Display in table each unique value and additional field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329525#M98070</link>
    <description>&lt;P&gt;I believe you are right in using dedup. You can specify multiple fields to dedup by and I think that is what you need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dedup ID ErrorID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you all of the possible unique combinations of ID and ErrorID&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2017 14:39:36 GMT</pubDate>
    <dc:creator>mdsnmss</dc:creator>
    <dc:date>2017-07-25T14:39:36Z</dc:date>
    <item>
      <title>Display in table each unique value and additional field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329524#M98069</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I am a very new splunk user and would like to conduct produce a table with of each unique ID and the corresponding error message.&lt;/P&gt;

&lt;P&gt;For context, each 'event' looks similar to this:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;'Date (?) name (?) error details'&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;So I have managed to extract the ID and ErrorID, but there are often multiple events of the same ID as that particular doc gets updated.  &lt;/P&gt;

&lt;P&gt;My thinking was to get each &lt;STRONG&gt;unique value of ID and then the corresponding ErrorID,&lt;/STRONG&gt; but im not sure how will splunk know which particular event of say (ID=123) to use for the ErrorID (note that for say all 5 instances of ID=123, ErrorID would most likely be the same).  &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Would one way be telling it to use the first instance of ID to display ErrorID?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I have searched through threads but no one has quite as what I need I believe, I think I may need to use 'Dedup' but not entirely how to make it get the corresponding ErrorID&lt;/P&gt;

&lt;P&gt;Cheers everyone - literally any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 09:43:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329524#M98069</guid>
      <dc:creator>splunk_95</dc:creator>
      <dc:date>2017-07-25T09:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Display in table each unique value and additional field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329525#M98070</link>
      <description>&lt;P&gt;I believe you are right in using dedup. You can specify multiple fields to dedup by and I think that is what you need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dedup ID ErrorID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you all of the possible unique combinations of ID and ErrorID&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 14:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329525#M98070</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2017-07-25T14:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Display in table each unique value and additional field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329526#M98071</link>
      <description>&lt;P&gt;Dedup will give you the most recently occurring event for each combination, if you need the first event, just add &lt;CODE&gt;| reverse&lt;/CODE&gt; before &lt;CODE&gt;| dedup ...&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 15:29:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329526#M98071</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-25T15:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Display in table each unique value and additional field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329527#M98072</link>
      <description>&lt;P&gt;Thanks  - out of interest would you know how I could replicate this in a timechart? Im thinking of using dc(distinct count) something like:&lt;BR /&gt;
dc(ID,ErrorID)? But do you think there would be a better way?&lt;BR /&gt;
Or is there a way of getting the number of instances of unique combinations? Thinking of maybe using &lt;CODE&gt;eval&lt;/CODE&gt;and assign a variable this value then using&lt;CODE&gt;stats count&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 16:51:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329527#M98072</guid>
      <dc:creator>splunk_95</dc:creator>
      <dc:date>2017-07-25T16:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Display in table each unique value and additional field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329528#M98073</link>
      <description>&lt;P&gt;Create an amalgam field with &lt;CODE&gt;| eval amalgam = ID . "::::" . ErrorID&lt;/CODE&gt; and timechart with &lt;CODE&gt;dc(amalgam)&lt;/CODE&gt;. &lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 17:55:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329528#M98073</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-25T17:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Display in table each unique value and additional field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329529#M98074</link>
      <description>&lt;P&gt;As a general case, I've found &lt;CODE&gt;dedup&lt;/CODE&gt; to be expensive, and I haven't been able to figure out in what cases it is and when it isn't.  As long as the events have a &lt;CODE&gt;_time&lt;/CODE&gt; value, you can use &lt;CODE&gt;stats&lt;/CODE&gt; with &lt;CODE&gt;earliest(foo)&lt;/CODE&gt; to get the first value of variable &lt;CODE&gt;foo&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search that gets _time, uniqueID and errorID
| stats min(_time) as _time, earliest(errorID) as errorID by uniqueID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jul 2017 21:06:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-in-table-each-unique-value-and-additional-field/m-p/329529#M98074</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-25T21:06:53Z</dc:date>
    </item>
  </channel>
</rss>

