<?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 How to create mutiple columns for a single field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26348#M177647</link>
    <description>&lt;P&gt;I have to make dashboard like different age limits as column heading &lt;BR /&gt;
eg. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;product    (age)20-25    (age)30 -35
product1          200        300
product2          500        600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How to do this in splunk ?&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2013 13:55:06 GMT</pubDate>
    <dc:creator>sumanth_isac</dc:creator>
    <dc:date>2013-05-07T13:55:06Z</dc:date>
    <item>
      <title>How to create mutiple columns for a single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26348#M177647</link>
      <description>&lt;P&gt;I have to make dashboard like different age limits as column heading &lt;BR /&gt;
eg. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;product    (age)20-25    (age)30 -35
product1          200        300
product2          500        600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How to do this in splunk ?&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2013 13:55:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26348#M177647</guid>
      <dc:creator>sumanth_isac</dc:creator>
      <dc:date>2013-05-07T13:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create mutiple columns for a single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26349#M177648</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| eval age_dist=floor(age/5)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you a field named age_dist with distinct values for every 5 values of age&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval age_range=case(age_dist==0,"(age)0-4",age_dist==1,"(age)5-9",...,age_dist==n,"(age)n*5-n*5+4")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you the age groupings you are looking for&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count by product age_range
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you the table you are looking for&lt;/P&gt;

&lt;P&gt;Your final search should look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval age_dist=floor(age/5) | eval age_range=case(age_dist==0,"(age)0-4",age_dist==1,"(age)5-9",...,age_dist==n,"(age)n*5-n*5+4") | stats count by product age_range
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2013 15:24:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26349#M177648</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2013-05-07T15:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create mutiple columns for a single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26350#M177649</link>
      <description>&lt;P&gt;Alternatively, if you don't need highly customized date ranges, you can use the bucket command before charting.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | bucket age span=5 | stats count by product,age
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 May 2013 18:00:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26350#M177649</guid>
      <dc:creator>ytamura</dc:creator>
      <dc:date>2013-05-07T18:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create mutiple columns for a single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26351#M177650</link>
      <description>&lt;P&gt;Thank you, got it now i want to include a $ sign for the values below (age)20-25&lt;/P&gt;

&lt;P&gt;product    (age)20-25    (age)30 -35&lt;BR /&gt;
product1          $200        $300&lt;BR /&gt;
product2          $500        $600&lt;/P&gt;

&lt;P&gt;How to do this as this table will be dynamic&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2013 06:17:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26351#M177650</guid>
      <dc:creator>sumanth_isac</dc:creator>
      <dc:date>2013-05-08T06:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to create mutiple columns for a single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26352#M177651</link>
      <description>&lt;P&gt;Hi, for adding $ you use eval again:&lt;BR /&gt;
eval age="$"+age&lt;/P&gt;

&lt;P&gt;Replace age with your actual field names&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2013 09:50:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26352#M177651</guid>
      <dc:creator>vj8210</dc:creator>
      <dc:date>2013-05-08T09:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create mutiple columns for a single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26353#M177652</link>
      <description>&lt;P&gt;There is no Actual field name VJ8210 there are dynamic field name is coming so we are not able to do that.&lt;/P&gt;

&lt;P&gt;Can you tell me how to add $ to dynamic field name.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2013 10:57:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26353#M177652</guid>
      <dc:creator>gajananh999</dc:creator>
      <dc:date>2013-05-08T10:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to create mutiple columns for a single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26354#M177653</link>
      <description>&lt;P&gt;See if the fieldformat command can help you: &lt;A href="http://splunk-base.splunk.com/answers/35124/format-result-set-numbers"&gt;http://splunk-base.splunk.com/answers/35124/format-result-set-numbers&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2013 16:30:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-mutiple-columns-for-a-single-field/m-p/26354#M177653</guid>
      <dc:creator>ytamura</dc:creator>
      <dc:date>2013-05-08T16:30:35Z</dc:date>
    </item>
  </channel>
</rss>

