<?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: Can I create a new field for each value contained in an existing field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154898#M43565</link>
    <description>&lt;P&gt;Can you add a sample of your input data and what the output should look like so that we get a better idea what you are trying to achieve.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Feb 2015 23:08:25 GMT</pubDate>
    <dc:creator>ramdaspr</dc:creator>
    <dc:date>2015-02-18T23:08:25Z</dc:date>
    <item>
      <title>Can I create a new field for each value contained in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154897#M43564</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm a bit unsure how to go about this, but essentially I'd like to create a new field for each value contained in an existing field.&lt;/P&gt;

&lt;P&gt;I have a field that we'll call &lt;EM&gt;name&lt;/EM&gt; containing several hundred entries. I'd like to create a new value for each field in &lt;EM&gt;name&lt;/EM&gt; containing the count of all entries associated with that name. &lt;/P&gt;

&lt;P&gt;In pseudo-code, I imagine it working something like this:&lt;BR /&gt;
&lt;CODE&gt;stats count(eval(name=n)) as "n"&lt;/CODE&gt; creating a new &lt;EM&gt;n&lt;/EM&gt; for every value contained in &lt;EM&gt;name&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;Is this possible?&lt;/P&gt;

&lt;P&gt;Can I loop a statement, populating &lt;EM&gt;n&lt;/EM&gt; with a new value each time?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2015 21:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154897#M43564</guid>
      <dc:creator>mrfredman</dc:creator>
      <dc:date>2015-02-18T21:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new field for each value contained in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154898#M43565</link>
      <description>&lt;P&gt;Can you add a sample of your input data and what the output should look like so that we get a better idea what you are trying to achieve.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2015 23:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154898#M43565</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-02-18T23:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new field for each value contained in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154899#M43566</link>
      <description>&lt;P&gt;I can't go into too much detail, but I'll do my best.&lt;/P&gt;

&lt;P&gt;My input contains 3 columns: id, name, and created date. &lt;/P&gt;

&lt;P&gt;The output I'm looking for is: a row for each month of the year, with a column name, and a count of ids per name/month.&lt;/P&gt;

&lt;P&gt;Sort of like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        Name Name2 Name3
Jan-14  1   0   3
Feb-14  2   4   4
Mar-14  0   0   1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(I've got all the time conversion and sorting  figured out, I'm just having trouble sorting by both month and name (I can easily do one or the other but not both) so I figured if each name had a field I could just count those fields by month)&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2015 23:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154899#M43566</guid>
      <dc:creator>mrfredman</dc:creator>
      <dc:date>2015-02-18T23:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new field for each value contained in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154900#M43567</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;.. | stats count(name) by date, name | transpose
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Feb 2015 23:42:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154900#M43567</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-02-18T23:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new field for each value contained in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154901#M43568</link>
      <description>&lt;P&gt;While that almost works, the end goal (which I haven't yet mentioned, apologies) is to chart this data in a line graph with a line for each name. &lt;/P&gt;

&lt;P&gt;As far as I can tell, I can't do this unless I'm able to break out each name into it's own field and ensure there is only 1 row per date.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2015 23:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154901#M43568</guid>
      <dc:creator>mrfredman</dc:creator>
      <dc:date>2015-02-18T23:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new field for each value contained in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154902#M43569</link>
      <description>&lt;P&gt;chart count over Name by month?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Feb 2015 01:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154902#M43569</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-02-19T01:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new field for each value contained in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154903#M43570</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;chart count(name) over date by name 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should give a line graph with lines for names and count as Y Axis and Date as the X-axis&lt;/P&gt;</description>
      <pubDate>Thu, 19 Feb 2015 02:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154903#M43570</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-02-19T02:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new field for each value contained in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154904#M43571</link>
      <description>&lt;P&gt;That did the trick. Thanks!&lt;/P&gt;

&lt;P&gt;This creates a new problem were all but the top 11 names get lumped into an Other category, but this certainly answers my initial question. &lt;/P&gt;</description>
      <pubDate>Thu, 19 Feb 2015 21:46:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154904#M43571</guid>
      <dc:creator>mrfredman</dc:creator>
      <dc:date>2015-02-19T21:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new field for each value contained in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154905#M43572</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; chart count(name) over date by name useother=f
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to force all series to be shown.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Feb 2015 22:25:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-create-a-new-field-for-each-value-contained-in-an-existing/m-p/154905#M43572</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-02-19T22:25:21Z</dc:date>
    </item>
  </channel>
</rss>

