<?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 rangemap search so that ranges will display as table columns? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289765#M87665</link>
    <description>&lt;P&gt;Simply change &lt;CODE&gt;stats&lt;/CODE&gt; to &lt;CODE&gt;chart&lt;/CODE&gt; and make it &lt;CODE&gt;BY host range&lt;/CODE&gt; instead of &lt;CODE&gt;BY range host&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2017 17:46:00 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-03-27T17:46:00Z</dc:date>
    <item>
      <title>How to edit my rangemap search so that ranges will display as table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289764#M87664</link>
      <description>&lt;P&gt;Hello! I am using Splunk to correlate packet statistics.  In a log we have the following fields: sencore_iat  and sencore_uncorrected_packets.  Our goal is to map a sencore_iat range to the total amount of uncorrected packets per host.  We are looking to make a table like below.  Lets say iat_range1 is IAT zero to 1 and iat_range2 is IAT from 1 to 5&lt;/P&gt;

&lt;P&gt;host | count(iat_in_range1) | total_uncorrected_packets_for_this_host_with_iat_range1 | count(iat_in_range2) | total_uncorrected_packets_for_this_host_with_iat_range2 .  &lt;/P&gt;

&lt;P&gt;Here is what I have so far: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;myBaseSeach| 
rangemap field=sencore_iat "0 to 1"=0-1 "1 to 5"=1-5 default="other" | 
stats 
count(sencore_iat) as total_occurances_of_iat
sum(sencore_uncorrected_packets) as sum_of_all_uncorreted_packets
by range,  host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search gives the correct data, however it is not how we want it displayed.  This search gives us the iat ranges from the rangemap command in a row, and we are looking to have each iat range from the rangemap command as a column.  I am wondering is this possible using the rangemap command? &lt;/P&gt;

&lt;P&gt;Please let me know if the question is unclear, or if I should not even be using the rangemap command.  Any help would be greatly appreciated! &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289764#M87664</guid>
      <dc:creator>cstarling</dc:creator>
      <dc:date>2020-09-29T13:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rangemap search so that ranges will display as table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289765#M87665</link>
      <description>&lt;P&gt;Simply change &lt;CODE&gt;stats&lt;/CODE&gt; to &lt;CODE&gt;chart&lt;/CODE&gt; and make it &lt;CODE&gt;BY host range&lt;/CODE&gt; instead of &lt;CODE&gt;BY range host&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 17:46:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289765#M87665</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-27T17:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rangemap search so that ranges will display as table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289766#M87666</link>
      <description>&lt;P&gt;This makes random test data ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval host="a a a a a a a a b b b b b b b b c c c c c c c c c d d d d d" 
| makemv host 
| mvexpand host
| eval rand=random()%100 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This maps the data , sorts the ranges to the desired order, produces the chart with columns as requested, then renames the columns to the desired names.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rangemap field=rand rangeA=0-40 rangeB=41-80 default=rangeC 
| rename range as myrange 
| stats count as mycount sum(rand) as mysum by myrange host 
| chart sum(mysum) over host by myrange
| rename rangeA as "0 to 1", rangeB as "1 to 5", rangeC as "other"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2017 17:49:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289766#M87666</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-27T17:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rangemap search so that ranges will display as table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289767#M87667</link>
      <description>&lt;P&gt;this works nicely.  Is there a way to change the order of the columns that are spit out by the chart command? &lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 18:13:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289767#M87667</guid>
      <dc:creator>cstarling</dc:creator>
      <dc:date>2017-03-27T18:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rangemap search so that ranges will display as table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289768#M87668</link>
      <description>&lt;P&gt;I got it with a simple table command.  Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 18:19:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289768#M87668</guid>
      <dc:creator>cstarling</dc:creator>
      <dc:date>2017-03-27T18:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rangemap search so that ranges will display as table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289769#M87669</link>
      <description>&lt;P&gt;This also works nicely.  I accepted the other answer simply because it was 3 mins quicker &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 18:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289769#M87669</guid>
      <dc:creator>cstarling</dc:creator>
      <dc:date>2017-03-27T18:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rangemap search so that ranges will display as table columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289770#M87670</link>
      <description>&lt;P&gt;Heh.  Serves me right for testing my code.  &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;  &lt;/P&gt;

&lt;P&gt;It's no big deal which one gets accepted or upvoted, just so you got what you needed.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 14:00:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rangemap-search-so-that-ranges-will-display-as/m-p/289770#M87670</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-28T14:00:35Z</dc:date>
    </item>
  </channel>
</rss>

