<?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 get max value from each columns that are created dynamicly based on time range in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418651#M120364</link>
    <description>&lt;P&gt;@maniu1609, try the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourBaseSearch&amp;gt;
|  bin _time span=1m
|  stats count by _time A1
|  eventstats max(count) as Maximum by A1
|  where count=Maximum
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: It will list multiple time for A1 if maximum count for specific A1 remains the same in multiple time buckets.&lt;/P&gt;</description>
    <pubDate>Fri, 25 May 2018 16:59:27 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-05-25T16:59:27Z</dc:date>
    <item>
      <title>How to get max value from each columns that are created dynamicly based on time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418650#M120363</link>
      <description>&lt;P&gt;search query | timechart span=1m count by A1&lt;/P&gt;

&lt;P&gt;the above query gives me below output:&lt;/P&gt;

&lt;P&gt;_time                                           column1        column2     column3&lt;BR /&gt;&lt;BR /&gt;
2018-05-25 10:20:05                      1                      1                  0&lt;BR /&gt;&lt;BR /&gt;
2018-05-25 10:09:39                      4                      0                  0&lt;BR /&gt;&lt;BR /&gt;
2018-05-25 10:27:16                      0                      2                  2&lt;BR /&gt;&lt;BR /&gt;
2018-05-25 10:22:06                      1                      1                  1&lt;BR /&gt;&lt;BR /&gt;
2018-05-25 10:12:45                      1                      1                  2&lt;BR /&gt;&lt;BR /&gt;
2018-05-25 10:25:07                      1                      1                  3                   &lt;/P&gt;

&lt;P&gt;No of columns depends on the time range we choose(i.e) sometimes 3 columns and sometimes 6 columns and so on..&lt;BR /&gt;
So if the above is my scenario, how I can find max values from each column and their _time value.&lt;/P&gt;

&lt;P&gt;My expected output is:&lt;/P&gt;

&lt;P&gt;_time                                           column1        column2     column3&lt;BR /&gt;&lt;BR /&gt;
2018-05-25 10:09:39                      4                      0                  0&lt;BR /&gt;&lt;BR /&gt;
2018-05-25 10:27:16                      0                      2                  2&lt;BR /&gt;&lt;BR /&gt;
2018-05-25 10:25:07                      1                      1                  3   &lt;/P&gt;

&lt;P&gt;so out main aim here is, how we can find max value of columns created dynamically.&lt;/P&gt;

&lt;P&gt;Please help me out. I'm struggling with my task.   &lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 11:31:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418650#M120363</guid>
      <dc:creator>maniu1609</dc:creator>
      <dc:date>2018-05-25T11:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from each columns that are created dynamicly based on time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418651#M120364</link>
      <description>&lt;P&gt;@maniu1609, try the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourBaseSearch&amp;gt;
|  bin _time span=1m
|  stats count by _time A1
|  eventstats max(count) as Maximum by A1
|  where count=Maximum
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: It will list multiple time for A1 if maximum count for specific A1 remains the same in multiple time buckets.&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 16:59:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418651#M120364</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-25T16:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from each columns that are created dynamicly based on time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418652#M120365</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search query | timechart span=1m count by A1
| eventstats max(*) as max*
| eval keep="N" 
| foreach max* [| eval keep=if('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'='&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;',"Y",keep) ]
| where keep="Y" | fields - max* keep
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 May 2018 17:58:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418652#M120365</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-25T17:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from each columns that are created dynamicly based on time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418653#M120366</link>
      <description>&lt;P&gt;It works great!!. Thanks!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 11:18:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418653#M120366</guid>
      <dc:creator>maniu1609</dc:creator>
      <dc:date>2018-05-29T11:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get max value from each columns that are created dynamicly based on time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418654#M120367</link>
      <description>&lt;P&gt;it also works for me!!. Thanks!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 11:18:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-max-value-from-each-columns-that-are-created/m-p/418654#M120367</guid>
      <dc:creator>maniu1609</dc:creator>
      <dc:date>2018-05-29T11:18:52Z</dc:date>
    </item>
  </channel>
</rss>

