<?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: Expanding CSV to a Multi-Valued Field in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Expanding-CSV-to-a-Multi-Valued-Field/m-p/32734#M5834</link>
    <description>&lt;P&gt;unless randlist is itself not getting the comma-separated list?   i.e. the last column in the above output suggests randlist is a single number.  The original syslog line definitely has the comma-sep list.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2011 17:13:55 GMT</pubDate>
    <dc:creator>jbp4444</dc:creator>
    <dc:date>2011-06-22T17:13:55Z</dc:date>
    <item>
      <title>Expanding CSV to a Multi-Valued Field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Expanding-CSV-to-a-Multi-Valued-Field/m-p/32731#M5831</link>
      <description>&lt;P&gt;I have a comma-separated list of 3 random values in a field called &lt;CODE&gt;randlist&lt;/CODE&gt; (syslog-like entries):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jun 22 10:39:46 bdgpu-login-01 randtest[19726]: xid=1308753586 rand3=2 rand1=0.147066939336213 randlist=0.147066939336213,7.29877393854405,2 rand2=7.29877393854405  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd like to grab the &lt;CODE&gt;randlist&lt;/CODE&gt; field and break it into a multi-valued field.  For now, there are 3 fields, but it could be a variable-sized list in the future.&lt;/P&gt;

&lt;P&gt;I.e. I'd like &lt;CODE&gt;randlist | ..something.. | eval c=mvcount(randlist)&lt;/CODE&gt; to produce a value of 3 (three items in the list)&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2011 15:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Expanding-CSV-to-a-Multi-Valued-Field/m-p/32731#M5831</guid>
      <dc:creator>jbp4444</dc:creator>
      <dc:date>2011-06-22T15:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding CSV to a Multi-Valued Field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Expanding-CSV-to-a-Multi-Valued-Field/m-p/32732#M5832</link>
      <description>&lt;P&gt;If you already have &lt;CODE&gt;randlist&lt;/CODE&gt; extracted, and you're using Splunk 4.1 or higher, you can use &lt;CODE&gt;split()&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval randlist=split(randlist, ",")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For older Splunk versions, use &lt;CODE&gt;rex&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2011 16:53:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Expanding-CSV-to-a-Multi-Valued-Field/m-p/32732#M5832</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2011-06-22T16:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding CSV to a Multi-Valued Field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Expanding-CSV-to-a-Multi-Valued-Field/m-p/32733#M5833</link>
      <description>&lt;P&gt;Hmm, seems like that should work ... but I don't get multiple values:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; randlist | eval r=split(randlist,",") | eval c=mvcount(r) | table _time c r*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the output shows:&lt;BR /&gt;
_time   c   r   rand1   rand2   rand3   randlist&lt;/P&gt;

&lt;P&gt;6/22/11 1:12:47.000 PM  1   0.544830349649022   0.544830349649022   4.65601461737279    3   0.544830349649022&lt;/P&gt;

&lt;P&gt;6/22/11 1:11:47.000 PM  1   0.570239085771959   0.570239085771959   4.57874341757059    5   0.570239085771959&lt;/P&gt;

&lt;P&gt;6/22/11 1:10:47.000 PM  1   0.284757352089141   0.284757352089141   5.87026520381151    1   0.284757352089141&lt;/P&gt;

&lt;P&gt;So only the first entry of randlist is being captured (I get the same result if I put "randlist=split(randlist..." in there too).  Tried adding 'mvexpand randlist' .. also didn't seem to help.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2011 17:12:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Expanding-CSV-to-a-Multi-Valued-Field/m-p/32733#M5833</guid>
      <dc:creator>jbp4444</dc:creator>
      <dc:date>2011-06-22T17:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding CSV to a Multi-Valued Field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Expanding-CSV-to-a-Multi-Valued-Field/m-p/32734#M5834</link>
      <description>&lt;P&gt;unless randlist is itself not getting the comma-separated list?   i.e. the last column in the above output suggests randlist is a single number.  The original syslog line definitely has the comma-sep list.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2011 17:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Expanding-CSV-to-a-Multi-Valued-Field/m-p/32734#M5834</guid>
      <dc:creator>jbp4444</dc:creator>
      <dc:date>2011-06-22T17:13:55Z</dc:date>
    </item>
  </channel>
</rss>

