<?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 do I parse one large comma-delimited field into multiple fields with numbered names? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/323596#M96608</link>
    <description>&lt;P&gt;Hi bstill,&lt;BR /&gt;
use regex in this way&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Measurement\=\"(?&amp;lt;Measurement_0&amp;gt;[^,]*),(?&amp;lt;Measurement_1&amp;gt;[^,]*),(?&amp;lt;Measurement_3&amp;gt;[^,]*),(?&amp;lt;Measurement_4&amp;gt;[^,]*),(?&amp;lt;Measurement_5&amp;gt;[^,]*),(?&amp;lt;Measurement_6&amp;gt;[^,]*),(?&amp;lt;Measurement_7&amp;gt;[^,]*),(?&amp;lt;Measurement_8&amp;gt;[^,]*),(?&amp;lt;Measurement_9&amp;gt;[^,]*),(?&amp;lt;Measurement_10&amp;gt;[^,]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=Measurement "(?&amp;lt;Measurement_0&amp;gt;[^,]*),(?&amp;lt;Measurement_1&amp;gt;[^,]*),(?&amp;lt;Measurement_3&amp;gt;[^,]*),(?&amp;lt;Measurement_4&amp;gt;[^,]*),(?&amp;lt;Measurement_5&amp;gt;[^,]*),(?&amp;lt;Measurement_6&amp;gt;[^,]*),(?&amp;lt;Measurement_7&amp;gt;[^,]*),(?&amp;lt;Measurement_8&amp;gt;[^,]*),(?&amp;lt;Measurement_9&amp;gt;[^,]*),(?&amp;lt;Measurement_10&amp;gt;[^,]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Test it at &lt;A href="https://regex101.com/r/d63INQ/1"&gt;https://regex101.com/r/d63INQ/1&lt;/A&gt;&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2017 15:41:14 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-10-23T15:41:14Z</dc:date>
    <item>
      <title>How do I parse one large comma-delimited field into multiple fields with numbered names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/323595#M96607</link>
      <description>&lt;P&gt;I have an event that looks similar to the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-10-18 16:59:30.943, MetaDataFoo="ValueFoo", Event_Time="2017-10-18 16:59:30.943", Measurement="45.89502,44.895,44.99505,44.89502,44.89502,45.42877,45.96756,46.09344,46.22437,46.315"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am trying to parse the "Measurement" field values into separate fields per value. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Measurement="45.89502,44.895,44.99505,44.89502,44.89502,45.42877,45.96756,46.09344,46.22437,46.315"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Turns Into the following fields:&lt;BR /&gt;
Measurement_0 = 45.89502&lt;BR /&gt;
Measurement_1 = 44.895&lt;BR /&gt;
Measurement_2 = 44.99505&lt;BR /&gt;
Measurement_3 = 44.89502&lt;BR /&gt;
etc...&lt;/P&gt;

&lt;P&gt;I feel like this could be done with &lt;STRONG&gt;eval&lt;/STRONG&gt; and &lt;STRONG&gt;mvindex&lt;/STRONG&gt;, but I really don't want to write an eval  for each new value since my actual dataset has 1024 values in the Measurement field. Any help would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:23:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/323595#M96607</guid>
      <dc:creator>bstill</dc:creator>
      <dc:date>2020-09-29T16:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse one large comma-delimited field into multiple fields with numbered names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/323596#M96608</link>
      <description>&lt;P&gt;Hi bstill,&lt;BR /&gt;
use regex in this way&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Measurement\=\"(?&amp;lt;Measurement_0&amp;gt;[^,]*),(?&amp;lt;Measurement_1&amp;gt;[^,]*),(?&amp;lt;Measurement_3&amp;gt;[^,]*),(?&amp;lt;Measurement_4&amp;gt;[^,]*),(?&amp;lt;Measurement_5&amp;gt;[^,]*),(?&amp;lt;Measurement_6&amp;gt;[^,]*),(?&amp;lt;Measurement_7&amp;gt;[^,]*),(?&amp;lt;Measurement_8&amp;gt;[^,]*),(?&amp;lt;Measurement_9&amp;gt;[^,]*),(?&amp;lt;Measurement_10&amp;gt;[^,]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=Measurement "(?&amp;lt;Measurement_0&amp;gt;[^,]*),(?&amp;lt;Measurement_1&amp;gt;[^,]*),(?&amp;lt;Measurement_3&amp;gt;[^,]*),(?&amp;lt;Measurement_4&amp;gt;[^,]*),(?&amp;lt;Measurement_5&amp;gt;[^,]*),(?&amp;lt;Measurement_6&amp;gt;[^,]*),(?&amp;lt;Measurement_7&amp;gt;[^,]*),(?&amp;lt;Measurement_8&amp;gt;[^,]*),(?&amp;lt;Measurement_9&amp;gt;[^,]*),(?&amp;lt;Measurement_10&amp;gt;[^,]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Test it at &lt;A href="https://regex101.com/r/d63INQ/1"&gt;https://regex101.com/r/d63INQ/1&lt;/A&gt;&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 15:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/323596#M96608</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-10-23T15:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse one large comma-delimited field into multiple fields with numbered names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/323597#M96609</link>
      <description>&lt;P&gt;Thanks for the answer. It may be that I have to do it that way. I was trying to not have to define it for every value, since the Measurement array size may be dynamic in the future and the array is so large.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 15:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/323597#M96609</guid>
      <dc:creator>bstill</dc:creator>
      <dc:date>2017-10-23T15:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse one large comma-delimited field into multiple fields with numbered names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/323598#M96610</link>
      <description>&lt;P&gt;I think this run anywhere code should provide structure for the solution:&lt;BR /&gt;
&lt;CODE&gt;| stats count | eval Measurement="first,second,third,fourth,fifth" | eval temp_measurements=split(Measurement, ",") | eval total_indexes=mvcount(temp_measurements) | eval indexval=mvrange(0,total_indexes,1) | mvexpand indexval | eval Measurement_{indexval}=mvindex(temp_measurements,indexval) | fields - temp_measurements indexval total_indexes | stats values(*) AS * BY Measurement&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;For inspiration, I credit the non-accepted solution by @aweitzman on this post:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/168916/iterate-over-all-values-of-a-multivalue-field.html"&gt;https://answers.splunk.com/answers/168916/iterate-over-all-values-of-a-multivalue-field.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I don't think this is super efficient, but it shouldl at least scale to cover large numbers of Measurements in small numbers of events.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 16:36:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/323598#M96610</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-10-23T16:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse one large comma-delimited field into multiple fields with numbered names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/585639#M204045</link>
      <description>&lt;P&gt;Thank you so much, I got half way there with streamstats, but then got lost, this essentially got rid of some &amp;lt;streamstats field&amp;gt; -1 logic that was frustrating me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;had some events like this that i wanted dynamic columns for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;level1, level2, level3&lt;/P&gt;&lt;P&gt;level1, level2, level3, level4&lt;/P&gt;&lt;P&gt;level1, level3, level3, level4, .... level7&lt;/P&gt;&lt;P&gt;level1&lt;/P&gt;&lt;P&gt;couldnt figure how dynamically create columns with regex.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 23:16:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-parse-one-large-comma-delimited-field-into-multiple/m-p/585639#M204045</guid>
      <dc:creator>cesaccenturefed</dc:creator>
      <dc:date>2022-02-17T23:16:55Z</dc:date>
    </item>
  </channel>
</rss>

