<?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 query for top value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39690#M9082</link>
    <description>&lt;P&gt;Let's say you have a log that looks like....&lt;/P&gt;

&lt;P&gt;X --    Y -- Z&lt;/P&gt;

&lt;P&gt;===   ===   ===&lt;/P&gt;

&lt;P&gt;AAA   BBB   123&lt;/P&gt;

&lt;P&gt;AAA   BBB   356&lt;/P&gt;

&lt;P&gt;YYY   ZZZ   800&lt;/P&gt;

&lt;P&gt;AAA   BBB   900&lt;/P&gt;

&lt;P&gt;YYY   ZZZ   345&lt;/P&gt;

&lt;P&gt;What query would allow me to extract the highest number Z where X and Y are equal.&lt;/P&gt;

&lt;P&gt;So for the example above, I would expect to see results like:&lt;/P&gt;

&lt;P&gt;AAA  BBB 900&lt;/P&gt;

&lt;P&gt;YYY  ZZZ 800&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Aug 2012 20:18:35 GMT</pubDate>
    <dc:creator>DTERM</dc:creator>
    <dc:date>2012-08-20T20:18:35Z</dc:date>
    <item>
      <title>query for top value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39690#M9082</link>
      <description>&lt;P&gt;Let's say you have a log that looks like....&lt;/P&gt;

&lt;P&gt;X --    Y -- Z&lt;/P&gt;

&lt;P&gt;===   ===   ===&lt;/P&gt;

&lt;P&gt;AAA   BBB   123&lt;/P&gt;

&lt;P&gt;AAA   BBB   356&lt;/P&gt;

&lt;P&gt;YYY   ZZZ   800&lt;/P&gt;

&lt;P&gt;AAA   BBB   900&lt;/P&gt;

&lt;P&gt;YYY   ZZZ   345&lt;/P&gt;

&lt;P&gt;What query would allow me to extract the highest number Z where X and Y are equal.&lt;/P&gt;

&lt;P&gt;So for the example above, I would expect to see results like:&lt;/P&gt;

&lt;P&gt;AAA  BBB 900&lt;/P&gt;

&lt;P&gt;YYY  ZZZ 800&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2012 20:18:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39690#M9082</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2012-08-20T20:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: query for top value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39691#M9083</link>
      <description>&lt;P&gt;Explain how X and Y are equal in the lines you're expecting to see? Also, do you mean that the actual log event looks like this in a kind of tabular format?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2012 20:36:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39691#M9083</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-08-20T20:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: query for top value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39692#M9084</link>
      <description>&lt;P&gt;Well, depending on the nature of X and Y, there are a couple of options, one of them being a simple string concatenation for the comparison:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval Q = X." ".Y | stats max(Z) AS Z by Q | rename Q AS "X and Y"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which would give you a table like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;X and Y          Z
AAA BBB          900
CCC DDD          800
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Krisitan&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2012 20:51:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39692#M9084</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-08-20T20:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: query for top value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39693#M9085</link>
      <description>&lt;P&gt;Perfect.  Thanks so much!!  But can you explain the "eval Q = X." ".Y" portion of that.  I don't quite get that...&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2012 14:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39693#M9085</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2012-08-21T14:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: query for top value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39694#M9086</link>
      <description>&lt;P&gt;The dot (.) is the concatenation operator; so the eval statement creates the 'AAA BBB' and 'CCC DDD' strings, which appear under the 'X and Y' heading. &lt;/P&gt;

&lt;P&gt;Of course, this could have been illustrated better with proper log events.&lt;/P&gt;

&lt;P&gt;The reason for doing so is that you'll need to find the highest value for the &lt;STRONG&gt;combination&lt;/STRONG&gt; of A and Y.&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2012 16:22:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39694#M9086</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-08-21T16:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: query for top value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39695#M9087</link>
      <description>&lt;P&gt;Thanks much!!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2012 13:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-for-top-value/m-p/39695#M9087</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2012-08-22T13:43:10Z</dc:date>
    </item>
  </channel>
</rss>

