<?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: Join two &amp;quot;stats values&amp;quot; columns by similar field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250562#M74866</link>
    <description>&lt;P&gt;Thanks this is so simple I was over thinking it. &lt;/P&gt;

&lt;P&gt;Question - does this respect the relationship between the values(OIDValue) column and the values(OID) column? In other words, does splunk know they correspond? It would appear that, although they line up, they aren't necessarily in rows as one would expect related data  to be. &lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2016 20:37:04 GMT</pubDate>
    <dc:creator>evan_roggenkamp</dc:creator>
    <dc:date>2016-07-08T20:37:04Z</dc:date>
    <item>
      <title>Join two "stats values" columns by similar field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250559#M74863</link>
      <description>&lt;P&gt;I am trying to join two searches with a common TrapID field. The OIDValue column corresponds with the OID Column&lt;/P&gt;

&lt;P&gt;The first: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cyan_varbind source=oriondb sourcetype=cyan_varbind | stats values(OIDValue) by TrapID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The second:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cyan_varbind source=oriondb sourcetype=cyan_varbind | stats values(OID) by TrapID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Visual: &lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i.imgur.com/vJlPp2y.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:04:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250559#M74863</guid>
      <dc:creator>evan_roggenkamp</dc:creator>
      <dc:date>2016-07-08T20:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Join two "stats values" columns by similar field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250560#M74864</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cyan_varbind source=oriondb sourcetype=cyan_varbind | stats values(OIDValue) values(OID)  by TrapID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:13:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250560#M74864</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-08T20:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Join two "stats values" columns by similar field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250561#M74865</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cyan_varbind source=oriondb sourcetype=cyan_varbind | stats values(OIDValue) values(OID) BY TrapID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:25:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250561#M74865</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-08T20:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Join two "stats values" columns by similar field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250562#M74866</link>
      <description>&lt;P&gt;Thanks this is so simple I was over thinking it. &lt;/P&gt;

&lt;P&gt;Question - does this respect the relationship between the values(OIDValue) column and the values(OID) column? In other words, does splunk know they correspond? It would appear that, although they line up, they aren't necessarily in rows as one would expect related data  to be. &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:37:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250562#M74866</guid>
      <dc:creator>evan_roggenkamp</dc:creator>
      <dc:date>2016-07-08T20:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Join two "stats values" columns by similar field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250563#M74867</link>
      <description>&lt;P&gt;No, to do that, you need to use &lt;CODE&gt;list&lt;/CODE&gt; instead of &lt;CODE&gt;values&lt;/CODE&gt;, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cyan_varbind source=oriondb sourcetype=cyan_varbind | stats list(OIDValue) list(OID) BY TrapID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or combine them first like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cyan_varbind source=oriondb sourcetype=cyan_varbind | eval OIDcombo = OID . ":" . OIDValue | stats values(OIDCombo) BY TrapID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250563#M74867</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-08T20:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Join two "stats values" columns by similar field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250564#M74868</link>
      <description>&lt;P&gt;This has been so helpful to me. I cannot thank you enough. &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:48:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250564#M74868</guid>
      <dc:creator>evan_roggenkamp</dc:creator>
      <dc:date>2016-07-08T20:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Join two "stats values" columns by similar field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250565#M74869</link>
      <description>&lt;P&gt;This has been immensely helpful for me as well!  Do you know how you would select just the most recent OIDValue for each OID?  For my examples I've got:&lt;BR /&gt;
main search | eval TransferResults = type ."=". status | stats values(TransferResults) by referenceId&lt;/P&gt;

&lt;P&gt;but each type has multiple statuses:&lt;BR /&gt;
IP=ERROR&lt;BR /&gt;
IP=SUCCESS&lt;BR /&gt;
NATIVE=ERROR&lt;BR /&gt;
NATIVE=SUCCESS&lt;BR /&gt;
X1=ERROR&lt;BR /&gt;
X1=SUCCESS&lt;/P&gt;

&lt;P&gt;and in this case, the most recent statuses are all =SUCCESS so I'm trying to show that.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 19:19:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-quot-stats-values-quot-columns-by-similar-field/m-p/250565#M74869</guid>
      <dc:creator>chrismcharvey</dc:creator>
      <dc:date>2019-06-07T19:19:19Z</dc:date>
    </item>
  </channel>
</rss>

