<?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 extract multiple multi-value fields from a multi-line event at index time via regex? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446932#M77760</link>
    <description>&lt;P&gt;That's correct. I interpreted alternative differently. &lt;/P&gt;</description>
    <pubDate>Fri, 04 Jan 2019 19:59:14 GMT</pubDate>
    <dc:creator>efavreau</dc:creator>
    <dc:date>2019-01-04T19:59:14Z</dc:date>
    <item>
      <title>How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446917#M77745</link>
      <description>&lt;P&gt;Needing help with multiple multi-value field extraction from a multiline event.  &lt;/P&gt;

&lt;P&gt;Expecting the result of the following extraction to index each of rowA values with each of rowC identifiers, and index each of rowB values with each of rowC identifiers, and extract the endtime into the record timestamp(s).&lt;/P&gt;

&lt;P&gt;An acceptable alternative to these associations is a record timestamped with EndTime with multivalue field rowA, multivalue field rowB, and multivalue field rowC.&lt;/P&gt;

&lt;P&gt;RowNameA,1432,4363,6223,7543,19182,...&lt;BR /&gt;
RowNameB,8383,2727,3221,...&lt;BR /&gt;
RowNameC,NumericalIdentifierA,NumericalIdentifierB,...&lt;BR /&gt;
RowNameD,TheDate,StartTime,EndTime,OtherNumbers,...&lt;/P&gt;

&lt;P&gt;I am stuck at (,(?\d+)[^\S]+) for the regex to pull out rowA values, which unfortunately cuts across all lines.  Apparently adding wildcard to the beginning of the regex misses values.  Apparently the tokenizer-based approach requires named columns.  Can someone demonstrate to me that Splunk is expressive enough at index time to extract the information in the manner I'm requesting?&lt;/P&gt;

&lt;P&gt;I am working with Splunk Cloud, with data files sourced via a Heavy Forwarder.  I've been unable to get the MV_ADD feature to work in transforms.conf, but have been able to get a single multi-value field to extract via the transform+field extraction console.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 21:00:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446917#M77745</guid>
      <dc:creator>jasonstanek</dc:creator>
      <dc:date>2018-12-13T21:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446918#M77746</link>
      <description>&lt;P&gt;Assuming that the record format is consistent, you can add &lt;CODE&gt;(?ms)^&lt;/CODE&gt; to the very beginning of the RegEx to tell Splunk to make it a multiline search and the &lt;CODE&gt;^&lt;/CODE&gt; is a &lt;CODE&gt;Start of record&lt;/CODE&gt; anchor character.  Then you build a RegEx that covers 4 lines.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 14:29:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446918#M77746</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-03T14:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446919#M77747</link>
      <description>&lt;P&gt;Thank you for the reply to the question - would like to understand the proposed answer better.&lt;/P&gt;

&lt;P&gt;If by "record format is consistent" you mean the number of comma separated items (tokens) on each row, the number of items on rows A,B,&amp;amp;C varies.  Row D is the only row that is predictably the same "format".&lt;/P&gt;

&lt;P&gt;If you mean something else, can you please elaborate?  &lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 14:55:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446919#M77747</guid>
      <dc:creator>jasonstanek</dc:creator>
      <dc:date>2019-01-03T14:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446920#M77748</link>
      <description>&lt;P&gt;You can probably still do it, but the RegEx must accommodate all variants.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 16:49:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446920#M77748</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-03T16:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446921#M77749</link>
      <description>&lt;P&gt;Because the number of tokens on a line is unbounded, it is not apparent that a RegEx can accommodate all variants.  For unbounded tokenization, the current understanding is that is for what the tokenization feature is intended - however the tokenization feature appears to work by columns only, not rows.  If you think a regex can accommodate all variants, please provide specifics.  &lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 17:04:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446921#M77749</guid>
      <dc:creator>jasonstanek</dc:creator>
      <dc:date>2019-01-03T17:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446922#M77750</link>
      <description>&lt;P&gt;You get what you need on a line and the end with &lt;CODE&gt;[^\r\n]*[\r\n]+&lt;/CODE&gt; and then start capturing on the next line until you get what you need and then use that same RegEx to skip to the next line.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 17:18:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446922#M77750</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-03T17:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446923#M77751</link>
      <description>&lt;P&gt;I need all of the comma separated values on a line.  I do not want to skip lines.  How does one use a regex instead of tokenization to pull &lt;EM&gt;all&lt;/EM&gt; the comma separated values on a line?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 17:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446923#M77751</guid>
      <dc:creator>jasonstanek</dc:creator>
      <dc:date>2019-01-03T17:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446924#M77752</link>
      <description>&lt;P&gt;You can use &lt;CODE&gt;kv&lt;/CODE&gt; for that at search time.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 17:31:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446924#M77752</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-03T17:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446925#M77753</link>
      <description>&lt;P&gt;What I am hearing is that "How do I extract multiple multi-value fields from a multi-line event at index time via regex" is not possible.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 17:36:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446925#M77753</guid>
      <dc:creator>jasonstanek</dc:creator>
      <dc:date>2019-01-03T17:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446926#M77754</link>
      <description>&lt;P&gt;Not sure that's true, because I do a multi-value rex on a single multi-line event. Need more details. Is the text on any of these lines fixed? If so, these consistent words can be used as positioning anchors in the rex statement. For example:&lt;BR /&gt;
Are RowNameA, RowNameB, RowNameC, RowNameD all fixed text? Any other pieces that are consistently found from entry to entry? That will help.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446926#M77754</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2019-01-04T15:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446927#M77755</link>
      <description>&lt;P&gt;Yes, the RowName's are all fixed text.  The only other pieces that are consistently found from entry to entry are the line breaks and comma separators.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:38:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446927#M77755</guid>
      <dc:creator>jasonstanek</dc:creator>
      <dc:date>2019-01-04T15:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446928#M77756</link>
      <description>&lt;P&gt;Are the number of entries consistent? A real sample might help.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 16:18:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446928#M77756</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2019-01-04T16:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446929#M77757</link>
      <description>&lt;P&gt;The number of rows is consistent.  The number of items separated by commas is not consistent.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 16:26:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446929#M77757</guid>
      <dc:creator>jasonstanek</dc:creator>
      <dc:date>2019-01-04T16:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446930#M77758</link>
      <description>&lt;P&gt;You mentioned &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;"An acceptable alternative to these&lt;BR /&gt;
associations is a record timestamped&lt;BR /&gt;
with EndTime with multivalue field&lt;BR /&gt;
rowA, multivalue field rowB, and&lt;BR /&gt;
multivalue field rowC."&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Here's a run anywhere example of getting that far. You can then mix and match as you need.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval logentry="
RowNameA,1432,4363,6223,7543,19182,...
RowNameB,8383,2727,3221,...
RowNameC,NumericalIdentifierA,NumericalIdentifierB,...
RowNameD,TheDate,StartTime,2019-01-04 12:00:00,OtherNumbers,...
"
| rex field=logentry "(?&amp;lt;RowNameA&amp;gt;.+)\n(?&amp;lt;RowNameB&amp;gt;.+)\n(?&amp;lt;RowNameC&amp;gt;.+)\n(RowNameD),(?&amp;lt;TheDate&amp;gt;[^,]+),(?&amp;lt;StartTime&amp;gt;[^,]+),(?&amp;lt;EndTime&amp;gt;[^,]+),(?&amp;lt;RowNameD_Remainder&amp;gt;.+)"
| eval A_timestamped=EndTime+","+RowNameA
| eval B_timestamped=EndTime+","+RowNameB
| eval C_timestamped=EndTime+","+RowNameC
| rex field=A_timestamped "(?&amp;lt;TimeA&amp;gt;[^,]+),(?&amp;lt;ARowLabel&amp;gt;[^,]+),(?&amp;lt;AValues&amp;gt;.+)"
| rex field=B_timestamped "(?&amp;lt;TimeB&amp;gt;[^,]+),(?&amp;lt;BRowLabel&amp;gt;[^,]+),(?&amp;lt;BValues&amp;gt;.+)"
| rex field=C_timestamped "(?&amp;lt;TimeC&amp;gt;[^,]+),(?&amp;lt;CRowLabel&amp;gt;[^,]+),(?&amp;lt;CValues&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Explanation:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;The first rex splits the rows&lt;/LI&gt;
&lt;LI&gt;Split row D into fields. I combined this into the regular expression used for step 1.&lt;/LI&gt;
&lt;LI&gt;For the *_timestamped fields, we cat the fields together under a new name each, giving you a new unique field that has what you are looking for. In the sample logentry, I gave EndTime a real value, so it was easier to follow.&lt;/LI&gt;
&lt;LI&gt;The example ends with timestamped fields, with multivalue fields. You can then further parse the multivalue fields using rex or split.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 04 Jan 2019 17:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446930#M77758</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2019-01-04T17:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446931#M77759</link>
      <description>&lt;P&gt;Thanks for the proposed answer.  Was looking for an index-time solution.  If I understand your proposal correctly, it appears this is a search-time solution.  Please correct if not the case.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 17:41:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446931#M77759</guid>
      <dc:creator>jasonstanek</dc:creator>
      <dc:date>2019-01-04T17:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446932#M77760</link>
      <description>&lt;P&gt;That's correct. I interpreted alternative differently. &lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 19:59:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446932#M77760</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2019-01-04T19:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446933#M77761</link>
      <description>&lt;P&gt;Somewhat.  Very few field extractions should be done at index-time anyway.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 03:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446933#M77761</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-14T03:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446934#M77762</link>
      <description>&lt;P&gt;Layout real events that cover all variants and what field/value pairs you need to get.  That is the only way that we can get through this.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 03:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446934#M77762</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-14T03:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple multi-value fields from a multi-line event at index time via regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446935#M77763</link>
      <description>&lt;P&gt;This is not possible with just splunk.  I suggest you talk to the folks at cribl (@cgales):&lt;/P&gt;

&lt;P&gt;&lt;A href="http://cribl.com/"&gt;http://cribl.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 23:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-multiple-multi-value-fields-from-a-multi-line/m-p/446935#M77763</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-18T23:23:22Z</dc:date>
    </item>
  </channel>
</rss>

