<?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 edit my search to remove duplicates from a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293677#M88656</link>
    <description>&lt;P&gt;It is my pleasure !  &lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2017 13:44:23 GMT</pubDate>
    <dc:creator>aakwah</dc:creator>
    <dc:date>2017-05-16T13:44:23Z</dc:date>
    <item>
      <title>How to edit my search to remove duplicates from a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293669#M88648</link>
      <description>&lt;P&gt;hi, I am using table which shows up duplicates, shown below. Here some track has multiple status (eg: Yellow and Red). In this case, row having 'Yellow' status for that track should appear.&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 13:58:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293669#M88648</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-05-15T13:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to remove duplicates from a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293670#M88649</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Generally you can filter out results in your search query as per the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Status!=Red
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 15:07:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293670#M88649</guid>
      <dc:creator>aakwah</dc:creator>
      <dc:date>2017-05-15T15:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to remove duplicates from a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293671#M88650</link>
      <description>&lt;P&gt;What is the reasoning behind showing the row with "Yellow".  Is this the latest status? &lt;/P&gt;

&lt;P&gt;If so, you could try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YOUR CURRENT SEARCH]
| sort -Status
| dedup Track_Name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 May 2017 15:14:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293671#M88650</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2017-05-15T15:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to remove duplicates from a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293672#M88651</link>
      <description>&lt;P&gt;Red and Yellow represents Priority level. I have to pick least priority that is Yellow.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 03:18:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293672#M88651</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-05-16T03:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to remove duplicates from a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293673#M88652</link>
      <description>&lt;P&gt;Red and Yellow shows the priority level. So if there is multiple priority for one track, row with least priority (Yellow) should be selected. &lt;BR /&gt;
If any track having only single status (Red or Yellow), it should show as it is.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 03:22:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293673#M88652</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-05-16T03:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to remove duplicates from a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293674#M88653</link>
      <description>&lt;P&gt;Thanks for the clarification.&lt;/P&gt;

&lt;P&gt;Then you need to use transaction command to create one big event that contains all the statuses for single track.&lt;/P&gt;

&lt;P&gt;Now Status filed became multivalue filed as it may contains Red and Yellow at the same time, then we count the values with Status_count=mvcount(Status).&lt;/P&gt;

&lt;P&gt;Finally we use case statements to determine the count of status, if it equals 2, then Status will be Yellow if not it will have the original value.&lt;/P&gt;

&lt;P&gt;The complete query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Search query | transaction Track_Name | eval Status_count=mvcount(Status) | eval Status=case(Status_count == 2, "Yellow", Status_count ==1 , Status)  | table Track_Name, Status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 10:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293674#M88653</guid>
      <dc:creator>aakwah</dc:creator>
      <dc:date>2017-05-16T10:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to remove duplicates from a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293675#M88654</link>
      <description>&lt;P&gt;Try setting a priority field and using the same to get desired results -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt;  | eval priority=case(Status=="GREEN", 1, Status=="Yellow", 2, Status=="Red", 3) | stats min(priority) as priority by Track_Name | eval Status=case(priority==1, "GREEN", priority==2,"Yellow", priority==3,"Red") | table Track_Name Status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 May 2017 11:48:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293675#M88654</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-05-16T11:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to remove duplicates from a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293676#M88655</link>
      <description>&lt;P&gt;thanks a lot for your working solution!!&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 13:28:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293676#M88655</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-05-16T13:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to remove duplicates from a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293677#M88656</link>
      <description>&lt;P&gt;It is my pleasure !  &lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 13:44:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-remove-duplicates-from-a-table/m-p/293677#M88656</guid>
      <dc:creator>aakwah</dc:creator>
      <dc:date>2017-05-16T13:44:23Z</dc:date>
    </item>
  </channel>
</rss>

