<?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: Is it possible to split comma separated values into a single column using field extraction in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-split-comma-separated-values-into-a-single/m-p/498622#M84973</link>
    <description>&lt;P&gt;Yes, but it's not pretty.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval input = "abcd, efgh, ijkl, mnop" 
| eval input = split(input, ", ") 
| mvexpand input 
| eval input = split(input, "") 
| streamstats count as v 
| mvexpand input 
| streamstats count as i by v 
| eval value{i} = input 
| stats values(value*) as value* by v 
| fields - v
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's likely that your goal can be achieved with a different approach entirely.&lt;/P&gt;</description>
    <pubDate>Sat, 21 Mar 2020 16:02:35 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2020-03-21T16:02:35Z</dc:date>
    <item>
      <title>Is it possible to split comma separated values into a single column using field extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-split-comma-separated-values-into-a-single/m-p/498621#M84972</link>
      <description>&lt;P&gt;Is it possible to split comma separated values into a single column using field extraction? &lt;/P&gt;

&lt;P&gt;for example:&lt;/P&gt;

&lt;P&gt;input:&lt;BR /&gt;
abcd, efgh, ijkl, mnop&lt;/P&gt;

&lt;P&gt;output:&lt;/P&gt;

&lt;HR /&gt;

&lt;PRE&gt;&lt;CODE&gt;    value 1   |    value 2    |    value 3    |   value 4   

      ------------------------------------------------      
     a       |       b       |       c      |     d      
     e       |       f       |       g      |     h      
     i       |       j       |       k      |     l      
     m       |       n       |       o      |     p     
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know I can use something like &lt;CODE&gt;&amp;lt;List&amp;gt;(?&amp;lt;val1&amp;gt;\w)(?&amp;lt;val2&amp;gt;\w)(?&amp;lt;val3&amp;gt;\w)(?&amp;lt;val4&amp;gt;\w)&amp;lt;/list&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;however is it possible to repeat the combination an unknown number of times within the  brackets?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Mar 2020 12:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-split-comma-separated-values-into-a-single/m-p/498621#M84972</guid>
      <dc:creator>nsgalea</dc:creator>
      <dc:date>2020-03-21T12:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to split comma separated values into a single column using field extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-split-comma-separated-values-into-a-single/m-p/498622#M84973</link>
      <description>&lt;P&gt;Yes, but it's not pretty.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval input = "abcd, efgh, ijkl, mnop" 
| eval input = split(input, ", ") 
| mvexpand input 
| eval input = split(input, "") 
| streamstats count as v 
| mvexpand input 
| streamstats count as i by v 
| eval value{i} = input 
| stats values(value*) as value* by v 
| fields - v
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's likely that your goal can be achieved with a different approach entirely.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Mar 2020 16:02:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-split-comma-separated-values-into-a-single/m-p/498622#M84973</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2020-03-21T16:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to split comma separated values into a single column using field extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-split-comma-separated-values-into-a-single/m-p/498623#M84974</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval _raw="abcd, efgh, ijkl, mnop, qrstu, vwxy"
| rex max_match=0 "(?&amp;lt;value1&amp;gt;[^\s,]+)(?&amp;lt;value2&amp;gt;[^\s,]+)(?&amp;lt;value3&amp;gt;[^\s,]+)(?&amp;lt;value4&amp;gt;[^\s,]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 21 Mar 2020 18:17:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-split-comma-separated-values-into-a-single/m-p/498623#M84974</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-21T18:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to split comma separated values into a single column using field extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-split-comma-separated-values-into-a-single/m-p/498624#M84975</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="abcd, efgh, ijkl, mnop" 
| rex mode=sed "s/(.*)/value1, value2, value3, value4
\1/g" 
| multikv forceheader=1 
| foreach value* 
    [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = split(trim('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'), "")] 
| eval counter = mvrange(0,mvcount(value1)) 
| stats values(value*) as value* by counter 
| foreach value* 
    [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = mvindex('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' , counter) ] 
| fields - counter
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't know what INPUT is, so I make this.&lt;BR /&gt;
If it is the result of any tallying, we can make it simply.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Mar 2020 22:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-split-comma-separated-values-into-a-single/m-p/498624#M84975</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-21T22:18:38Z</dc:date>
    </item>
  </channel>
</rss>

