<?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 find the distinct value from the from two fields value ..... in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69483#M180542</link>
    <description>&lt;P&gt;Based on all your comments and responses to peoples comments it would seem that what you are looking for is the following:&lt;/P&gt;

&lt;P&gt;Field1=* | dedup countryName sortby -Field1&lt;/P&gt;

&lt;P&gt;This will ensure that you only pick up events that have a Field1 value (where Field1 is not null), and then remove duplicates on the countryName picking the one with the most recent Field1 value.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2013 19:41:33 GMT</pubDate>
    <dc:creator>aholzer</dc:creator>
    <dc:date>2013-03-21T19:41:33Z</dc:date>
    <item>
      <title>How to find the distinct value from the from two fields value .....</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69476#M180535</link>
      <description>&lt;P&gt;I have two fields which have different timestamps ...so i need to identify the difference of the two values from it ....&lt;BR /&gt;
i have generated regex and obtained the values for that fields ,,, and used table  to display the values &lt;BR /&gt;
The table look like this&lt;/P&gt;

&lt;P&gt;CountryName                           Field1                                Field2&lt;BR /&gt;
Aus1345                      Mar 21, 2013 9:46:55 AM&lt;BR /&gt;
Sgp3785                      Mar 21, 2013 9:43:34 AM&lt;BR /&gt;
Can3452                      Mar 21, 2013 9:42:13 AM&lt;BR /&gt;
Are2904                      Mar 21, 2013 9:37:08 AM&lt;BR /&gt;
Pak2123                      Mar 21, 2013 9:31:02 AM&lt;BR /&gt;
Can4535                                                           Mar 21, 2013 9:46:55 AM&lt;BR /&gt;
Pak4653                                                           Mar 21, 2013 9:46:55 AM&lt;BR /&gt;
Sgp3785                                                           Mar 21, 2013 9:43:34 AM&lt;BR /&gt;
Aus1345                                                           Mar 21, 2013 9:46:55 AM&lt;/P&gt;

&lt;P&gt;Here this table contains duplicates like same countryname repeated so , i need to find only the  countryname with respect to Field1 . so i need the countryname with Field1 (timings) alone ...&lt;BR /&gt;
as given below ......  So eliminate the duplicate countryname by matching the timestamps of field1 and field2 ..... I need the countryname along with field1&lt;/P&gt;

&lt;P&gt;I have identify this table by merging logs ......... so i need the countryname by finding  difference between field1 and field2 ..... the difference of field1 and field2 with respect to field1 should be displayed  with countryname ...as below ........&lt;/P&gt;

&lt;P&gt;CountryName                           Field1      &lt;/P&gt;

&lt;P&gt;Can3452                      Mar 21, 2013 9:42:13 AM&lt;BR /&gt;
Are2904                      Mar 21, 2013 9:37:08 AM&lt;BR /&gt;
Pak2123                      Mar 21, 2013 9:31:02 AM&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 11:19:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69476#M180535</guid>
      <dc:creator>dilstn</dc:creator>
      <dc:date>2013-03-21T11:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the distinct value from the from two fields value .....</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69477#M180536</link>
      <description>&lt;P&gt;To rephrase, you want to drop all rows where Field1's value exists somewhere in any Field2?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 13:02:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69477#M180536</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-21T13:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the distinct value from the from two fields value .....</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69478#M180537</link>
      <description>&lt;P&gt;Not fully understanding how your actual event look like, you could try something along the likes of;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Field1=* | search NOT [search Field2=* | rename Field2 as Field1 | fields + Field1]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The subsearch (within square brackets) will execute first and return its results to the outer search, like so;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Field1=*  | search NOT ((Field1=X) OR (Field1=Y) OR (Field1=Z))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Of course you might want to add constraints on sourcetypes, hosts etc etc.&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;

&lt;P&gt;You should always post a few sample events, since that will help the community to better understand your problem.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 13:13:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69478#M180537</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-03-21T13:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the distinct value from the from two fields value .....</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69479#M180538</link>
      <description>&lt;P&gt;Here this table contains duplicates like same countryname repeated so , i need to find unique countryname with respect to Field1 . so i need the countryname with Field1 timings alone ......So eliminate the duplicate countryname ......by matching field1 with field2 ....&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 14:15:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69479#M180538</guid>
      <dc:creator>dilstn</dc:creator>
      <dc:date>2013-03-21T14:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the distinct value from the from two fields value .....</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69480#M180539</link>
      <description>&lt;P&gt;Here this table contains duplicates like same countryname repeated so , i need to find unique countryname with respect to Field1 . so i need the countryname with Field1 timings alone ...so eliminate the duplicate countryname...by matching field1 with field2....&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 14:16:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69480#M180539</guid>
      <dc:creator>dilstn</dc:creator>
      <dc:date>2013-03-21T14:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the distinct value from the from two fields value .....</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69481#M180540</link>
      <description>&lt;P&gt;Not unique countryname, i need countryname with respect to field1(timings) alone .....&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 14:23:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69481#M180540</guid>
      <dc:creator>dilstn</dc:creator>
      <dc:date>2013-03-21T14:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the distinct value from the from two fields value .....</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69482#M180541</link>
      <description>&lt;P&gt;Not unique countryname, i need countryname with respect to field1(timings) alone .....&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 14:23:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69482#M180541</guid>
      <dc:creator>dilstn</dc:creator>
      <dc:date>2013-03-21T14:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the distinct value from the from two fields value .....</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69483#M180542</link>
      <description>&lt;P&gt;Based on all your comments and responses to peoples comments it would seem that what you are looking for is the following:&lt;/P&gt;

&lt;P&gt;Field1=* | dedup countryName sortby -Field1&lt;/P&gt;

&lt;P&gt;This will ensure that you only pick up events that have a Field1 value (where Field1 is not null), and then remove duplicates on the countryName picking the one with the most recent Field1 value.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 19:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-distinct-value-from-the-from-two-fields-value/m-p/69483#M180542</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2013-03-21T19:41:33Z</dc:date>
    </item>
  </channel>
</rss>

