<?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: match values in same fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450342#M127528</link>
    <description>&lt;P&gt;Forget my other answer entirely.  Take your existing search (everything up to the first pipe) and add &lt;STRONG&gt;this&lt;/STRONG&gt; answer to the bottom of that.  Done.&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2019 22:28:09 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-05-13T22:28:09Z</dc:date>
    <item>
      <title>match values in same fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450334#M127520</link>
      <description>&lt;P&gt;Hi, i would match two field, exactly:&lt;BR /&gt;
field1   -  field2&lt;BR /&gt;
   1       -  Empty&lt;BR /&gt;
   1       -  Empty&lt;BR /&gt;
   1       -  Empty&lt;BR /&gt;
Empty -      2&lt;BR /&gt;
Empty -      2&lt;/P&gt;

&lt;H2&gt;Empty -      2&lt;/H2&gt;

&lt;P&gt;It's possible sort the values in order to obtain this?:&lt;BR /&gt;
field1 -   field2&lt;BR /&gt;
   1      -     2&lt;BR /&gt;
   1      -     2&lt;BR /&gt;
   1      -     2&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 13:36:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450334#M127520</guid>
      <dc:creator>perryd</dc:creator>
      <dc:date>2019-05-09T13:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: match values in same fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450335#M127521</link>
      <description>&lt;P&gt;Would need more information regarding what you wish to achieve here. From where did the current output is coming, as a result of a search or from raw data directly? Will there always be same number of rows for each field which has values?&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 14:42:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450335#M127521</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-05-09T14:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: match values in same fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450336#M127522</link>
      <description>&lt;P&gt;So, my number of row its variable. My data its in a unique index. You can image one index with 3 fields:&lt;BR /&gt;
FIELD1                 -     FIELD2       -         FIELD3&lt;BR /&gt;
Hostname1       -       values        -        null()&lt;BR /&gt;
Hostname2       -       values        -        null()&lt;BR /&gt;
Hostname3       -        values        -       null()&lt;BR /&gt;
Hostname4       -        values        -       null()&lt;BR /&gt;
....................       -        ................    -       ........... &lt;BR /&gt;
HostnameN       -     values          -       null()&lt;BR /&gt;
Hostname1       -      null()            -      values&lt;BR /&gt;&lt;BR /&gt;
Hostname2       -      null()            -       values&lt;BR /&gt;&lt;BR /&gt;
Hostname3       -      null()            -       values&lt;BR /&gt;&lt;BR /&gt;
Hostname4       -      null()            -        values&lt;BR /&gt;&lt;BR /&gt;
....................        -     ................     -          ........... &lt;/P&gt;

&lt;H2&gt;HostnameN       -      null()             -     values     &lt;/H2&gt;

&lt;P&gt;What i wont is a match for values in field2  with values in field3.  My key is Field 1. My search result should look like this:&lt;BR /&gt;
FIELD1                 -     FIELD2          -         FIELD3&lt;BR /&gt;
Hostname1         -     values          -          values&lt;BR /&gt;&lt;BR /&gt;
Hostname2        -     values           -          values&lt;BR /&gt;&lt;BR /&gt;
Hostname3         -    values           -          values&lt;BR /&gt;&lt;BR /&gt;
Hostname4         -    values           -          values&lt;BR /&gt;&lt;BR /&gt;
....................         -  ................        -          ...............&lt;BR /&gt;
Hostnamen         -    values          -          values     &lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 15:32:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450336#M127522</guid>
      <dc:creator>perryd</dc:creator>
      <dc:date>2019-05-09T15:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: match values in same fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450337#M127523</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval raw="field1=A field1=B field1=C field1=D field2=1 field2=2 field2=3 field2=4"
| makemv raw
| mvexpand raw
| rename raw AS _raw
| kv
| table field*

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| streamstats count(field1) AS F1 count(field2) AS F2
| foreach F* [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = if(isnull(field&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;), null(), &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;) ]
| eval _F=coalesce(F1, F2)
| fields - F*
| selfjoin _F
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 May 2019 18:29:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450337#M127523</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-11T18:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: match values in same fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450338#M127524</link>
      <description>&lt;P&gt;My other answer answered the question that you actually asked, but given your clarification comment, what you actually need is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats values(*) AS * BY FIELD1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 May 2019 18:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450338#M127524</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-11T18:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: match values in same fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450339#M127525</link>
      <description>&lt;P&gt;the problem is that i've about 11000 row and i can't calculate  " eval raw="field1=A field1=B field1=C field1=D field2=1 field2=2 field2=3 field2=4"&lt;BR /&gt;
there is some function that do it automatically?&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 06:58:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450339#M127525</guid>
      <dc:creator>perryd</dc:creator>
      <dc:date>2019-05-13T06:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: match values in same fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450340#M127526</link>
      <description>&lt;P&gt;Did you even try my solution?  It handles variable number/names of fields dynamically.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 19:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450340#M127526</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-13T19:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: match values in same fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450341#M127527</link>
      <description>&lt;P&gt;i don't know what put in the row "| eval raw="field1=A field1=B field1=C field1=D field2=1 field2=2 field2=3 field2=4". &lt;BR /&gt;
You say me that it is dynamic, but what i write? I've need to use two fields and 11000 row...&lt;BR /&gt;
maybe i'm not understand, i'm sorry.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 19:44:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450341#M127527</guid>
      <dc:creator>perryd</dc:creator>
      <dc:date>2019-05-13T19:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: match values in same fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450342#M127528</link>
      <description>&lt;P&gt;Forget my other answer entirely.  Take your existing search (everything up to the first pipe) and add &lt;STRONG&gt;this&lt;/STRONG&gt; answer to the bottom of that.  Done.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 22:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/match-values-in-same-fields/m-p/450342#M127528</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-13T22:28:09Z</dc:date>
    </item>
  </channel>
</rss>

