<?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: Rex not iterating over large string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-iterating-over-large-string/m-p/269732#M81173</link>
    <description>&lt;P&gt;The rex command by default matches only one. Use max_matchoption to increase that limit&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ...| rex max_match=100 "(HOSTNAME: )(?&amp;lt;node_name&amp;gt;.*)\s\(" | table node_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 07 Sep 2016 21:47:51 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-09-07T21:47:51Z</dc:date>
    <item>
      <title>Rex not iterating over large string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-iterating-over-large-string/m-p/269731#M81172</link>
      <description>&lt;P&gt;I am trying to use rex to extract the hostnames and put them in a table, but rex is only matching the first string and then it stops&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "(HOSTNAME: )(?&amp;lt;node_name&amp;gt;.*)\s\(" | table node_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The data is part of a job log I am ingesting files and directories input. &lt;/P&gt;

&lt;P&gt;The textfile is formatted like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;___________________________________________________________________________
HOSTNAME: HOST-ASR9001-Aggr1.mrcl1.domain.net (10.140.255.7):
 ERROR: Cannot download Running config : Connection Refused by 10.140.255.7
___________________________________________________________________________
HOSTNAME: HOST-ASR9001-Aggr1.abvl1.domain.net (10.252.255.50):
downloaded Running config
___________________________________________________________________________
HOSTNAME: HOST-ASR9001-Aggr1.blvw1.domain.net (10.196.255.5):
downloaded Running config
__________________________________________________________________________
HOSTNAME: HOST-ASR9001-Aggr1.clem1.domain.net (10.196.255.1):
downloaded Running config
___________________________________________________________________________
HOSTNAME: HOST-ASR9001-Aggr1.domain.net (10.140.255.9):
downloaded Running config
___________________________________________________________________________
HOSTNAME: HOST-ASR9001-Aggr1.drck1.domain.net (10.132.255.3):
downloaded Running config
___________________________________________________________________________
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I did have to clean this file up with python before getting it into splunk, so if some kind of text operation/reorganization would help this go more smoothly that is definitely an option. &lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2016 21:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-not-iterating-over-large-string/m-p/269731#M81172</guid>
      <dc:creator>evan_roggenkamp</dc:creator>
      <dc:date>2016-09-07T21:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rex not iterating over large string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-iterating-over-large-string/m-p/269732#M81173</link>
      <description>&lt;P&gt;The rex command by default matches only one. Use max_matchoption to increase that limit&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ...| rex max_match=100 "(HOSTNAME: )(?&amp;lt;node_name&amp;gt;.*)\s\(" | table node_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Sep 2016 21:47:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-not-iterating-over-large-string/m-p/269732#M81173</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-07T21:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rex not iterating over large string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-iterating-over-large-string/m-p/269733#M81174</link>
      <description>&lt;P&gt;try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;HOSTNAME:\s+(?&amp;lt;myfield&amp;gt;[^ ]+)/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can test it on &lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt;&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 11:33:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-not-iterating-over-large-string/m-p/269733#M81174</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-09-08T11:33:43Z</dc:date>
    </item>
  </channel>
</rss>

