<?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 capture the repeating pattern on multiple lines with REX? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-capture-the-repeating-pattern-on-multiple-lines-with/m-p/428563#M122601</link>
    <description>&lt;P&gt;"This is close.. although it takes all the ZoneVal &amp;amp; lops them into the same field value. I need them to be different values. &lt;/P&gt;

&lt;P&gt;after rethinking it, broke into 2 rex's. &lt;/P&gt;

&lt;P&gt;| rex "zone:\s+(?\S+)"&lt;BR /&gt;
| rex max_match=0 "(?\S\S:\S\S:\S\S:\S\S:\S\S:\S\S:\S\S:\S\S)"&lt;/P&gt;

&lt;P&gt;That nailed it... although dang it! my first attempt should have worked! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; "&lt;/P&gt;</description>
    <pubDate>Tue, 28 Aug 2018 17:05:37 GMT</pubDate>
    <dc:creator>clintla</dc:creator>
    <dc:date>2018-08-28T17:05:37Z</dc:date>
    <item>
      <title>How do I capture the repeating pattern on multiple lines with REX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-capture-the-repeating-pattern-on-multiple-lines-with/m-p/428560#M122598</link>
      <description>&lt;P&gt;With this dataset, the linebreaker is zone:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; zone:  zone_1wwns
        00:00:00:00:00:00:00:01

 zone:  zone_2wwns
        00:00:00:00:00:00:00:02
        00:00:00:00:00:00:00:03

 zone:  zone_3wwns  
        00:00:00:00:00:00:00:04
        00:00:00:00:00:00:00:05
            00:00:00:00:00:00:00:06
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I use the regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex max_match=0 "zone:\s+(?\w+)((\s+(?\S\S\:\S\S\:\S\S\:\S\S\:\S\S\:\S\S\:\S\S\:\S\S))+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It captures the last wwn, when I remove the (+) at the end, then it captures the first wwn&lt;/P&gt;

&lt;P&gt;When I do this search w/ Notepad++ it finds all wwns (my most used tool for testing rex). Seems like this should work. &lt;BR /&gt;
Is there another way to capture these possible extra lines?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:30:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-capture-the-repeating-pattern-on-multiple-lines-with/m-p/428560#M122598</guid>
      <dc:creator>clintla</dc:creator>
      <dc:date>2018-08-28T14:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I capture the repeating pattern on multiple lines with REX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-capture-the-repeating-pattern-on-multiple-lines-with/m-p/428561#M122599</link>
      <description>&lt;P&gt;Notepad++ is great, but I believe it does not use a Perl-compatible regex engine (PCRE) like Splunk does.  Most folks here use regex101.com to test their regular expressions.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:39:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-capture-the-repeating-pattern-on-multiple-lines-with/m-p/428561#M122599</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-08-28T14:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I capture the repeating pattern on multiple lines with REX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-capture-the-repeating-pattern-on-multiple-lines-with/m-p/428562#M122600</link>
      <description>&lt;P&gt;Give this a try (runanywhere sample, everything before rex command is to generate sample data)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval raw="zone: zone_1wwns
 00:00:00:00:00:00:00:01
##zone: zone_2wwns
 00:00:00:00:00:00:00:02
 00:00:00:00:00:00:00:03
##zone: zone_3wwns
 00:00:00:00:00:00:00:04
 00:00:00:00:00:00:00:05
 00:00:00:00:00:00:00:06" | table raw | makemv raw delim="##" | mvexpand raw 
| rex field=raw max_match=0 "zone:\s+(?&amp;lt;zone&amp;gt;\w+)[\r\n\s](?&amp;lt;ZoneVal&amp;gt;\s*((\d{2}\:)+\d+[\r\n\s]*)+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Aug 2018 15:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-capture-the-repeating-pattern-on-multiple-lines-with/m-p/428562#M122600</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-08-28T15:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I capture the repeating pattern on multiple lines with REX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-capture-the-repeating-pattern-on-multiple-lines-with/m-p/428563#M122601</link>
      <description>&lt;P&gt;"This is close.. although it takes all the ZoneVal &amp;amp; lops them into the same field value. I need them to be different values. &lt;/P&gt;

&lt;P&gt;after rethinking it, broke into 2 rex's. &lt;/P&gt;

&lt;P&gt;| rex "zone:\s+(?\S+)"&lt;BR /&gt;
| rex max_match=0 "(?\S\S:\S\S:\S\S:\S\S:\S\S:\S\S:\S\S:\S\S)"&lt;/P&gt;

&lt;P&gt;That nailed it... although dang it! my first attempt should have worked! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; "&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 17:05:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-capture-the-repeating-pattern-on-multiple-lines-with/m-p/428563#M122601</guid>
      <dc:creator>clintla</dc:creator>
      <dc:date>2018-08-28T17:05:37Z</dc:date>
    </item>
  </channel>
</rss>

