<?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 edit my search to create a 3 column table with proper grouping of values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141850#M39315</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;... | stats max(c84162281) as "Average Seizure Traffic per Line (Trunk Group)" by LABEL,TB_Category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just add TG_Category to the grouping and it will provide the result by label and category. &lt;/P&gt;</description>
    <pubDate>Sun, 12 Apr 2015 23:52:24 GMT</pubDate>
    <dc:creator>ramdaspr</dc:creator>
    <dc:date>2015-04-12T23:52:24Z</dc:date>
    <item>
      <title>How to edit my search to create a 3 column table with proper grouping of values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141849#M39314</link>
      <description>&lt;P&gt;How do i create the 3 column table below in splunk (i.e. Label 1-3 would fall into Group1....etc):&lt;/P&gt;

&lt;P&gt;&lt;A target="_blank" href="http://tinypic.com?ref=352m845"&gt;&lt;IMG src="http://i57.tinypic.com/352m845.jpg" alt="Image and video hosting by TinyPic" /&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I can get a 2 column table using (column 2 and 3 in the above table): &lt;BR /&gt;
&lt;CODE&gt;... | stats max(c84162281) as "Average Seizure Traffic per Line (Trunk Group)" by LABEL&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;but now I want to add the 1st column which has the values I want in the field &lt;CODE&gt;TG_Category&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2015 23:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141849#M39314</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-04-12T23:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a 3 column table with proper grouping of values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141850#M39315</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;... | stats max(c84162281) as "Average Seizure Traffic per Line (Trunk Group)" by LABEL,TB_Category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just add TG_Category to the grouping and it will provide the result by label and category. &lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2015 23:52:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141850#M39315</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-04-12T23:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a 3 column table with proper grouping of values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141851#M39316</link>
      <description>&lt;P&gt;tks i use this search &lt;CODE&gt;...| stats max(c84162281) as "Average Seizure Traffic per Line (Trunk Group)" by TG_Category, LABEL | sort - TG_Category&lt;/CODE&gt; and this is good. &lt;/P&gt;

&lt;P&gt;but it gives me something like this &lt;BR /&gt;
&lt;A target="_blank" href="http://tinypic.com?ref=w2u7d"&gt;&lt;IMG src="http://i59.tinypic.com/w2u7d.jpg" alt="Image and video hosting by TinyPic" /&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;but what I really want is: &lt;BR /&gt;
&lt;A target="_blank" href="http://tinypic.com?ref=352m845"&gt;&lt;IMG src="http://i57.tinypic.com/352m845.jpg" alt="Image and video hosting by TinyPic" /&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And ideally it would be great if I could sort by &lt;CODE&gt;max&lt;/CODE&gt; Label in each Group, something like this but obviously for each group(here I am only showing group1)&lt;BR /&gt;
&lt;A target="_blank" href="http://tinypic.com?ref=1zv7ott"&gt;&lt;IMG src="http://i59.tinypic.com/1zv7ott.jpg" alt="Image and video hosting by TinyPic" /&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2015 01:27:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141851#M39316</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-04-13T01:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a 3 column table with proper grouping of values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141852#M39317</link>
      <description>&lt;P&gt;regarding the sorting, you can add multiple columns to the sort command as well, so in this case it would be  &lt;CODE&gt;sort - TG_ Category +max&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Reg. the formatting, if you mean you want to show nothing if the group name is same as above, it might be possible using streamstats to create a column which shows it like that&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;original query| streamstats current=f window=1 first(TG_Category) as lstcat | eval cul=if(lstcat=TG_Category,"",TG_Category) | table TG,Category,Label,max
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Apr 2015 01:54:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141852#M39317</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-04-13T01:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a 3 column table with proper grouping of values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141853#M39318</link>
      <description>&lt;P&gt;tks very much but I want group1 with all its labels and then group2 ...etc &lt;BR /&gt;
that does group1 then group2 then group1 again the group3...group2..grroup1 if you know what I mean. &lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2015 03:13:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141853#M39318</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-04-13T03:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a 3 column table with proper grouping of values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141854#M39319</link>
      <description>&lt;P&gt;sorry a bit sleepy but got that to work, ignore my last comment &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;...| sort +TG_Category -"Average Seizure Traffic per Line (Trunk Group)" | streamstats current=f window=1 first(TG_Category) as lstcat | eval cul=if(lstcat=TG_Category,"",TG_Category) | table cul, LABEL, "Average Seizure Traffic per Line (Trunk Group)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;now I need to work out how to add a timestamp cloumn that cooresponds with when that max occured.. tks again&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2015 03:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141854#M39319</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-04-13T03:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a 3 column table with proper grouping of values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141855#M39320</link>
      <description>&lt;P&gt;to achive the timestamp I will have to workout away to handle duplicates i.e. if 2 maxes that are the same occur at the hours 9 and 10. One way around this is to do it at a lower granularity e.g. 15minutes that way they will not be any duplicates, assuming 24hour clock.&lt;/P&gt;

&lt;P&gt;search using an hour timestamp will have issue with duplicates:&lt;BR /&gt;
&lt;CODE&gt;...| stats max(c84162281) as "Average Seizure Traffic per Line (Trunk Group)" by TG_Category, LABEL, date_hour | sort +TG_Category -"Average Seizure Traffic per Line (Trunk Group)" | streamstats current=f window=1 first(TG_Category) as lstcat | eval cul=if(lstcat=TG_Category,"",TG_Category) | table cul, LABEL, "Average Seizure Traffic per Line (Trunk Group)" date_hour&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2015 03:35:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141855#M39320</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-04-13T03:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a 3 column table with proper grouping of values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141856#M39321</link>
      <description>&lt;P&gt;I like doing that as well&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats max(c84162281) as max by Group Label | sort Group Label | stats list(Label) as Label list(max) as max by Group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is just about the only time I use list(). Note you have to do your sorting before the second stats command otherwise it will skew the associations between, in this case, Label and max.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 11:33:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-3-column-table-with-proper/m-p/141856#M39321</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2015-04-14T11:33:44Z</dc:date>
    </item>
  </channel>
</rss>

