<?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 invalid argument in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/rex-invalid-argument/m-p/323615#M4583</link>
    <description>&lt;P&gt;Interesting.   It is not you, it is something quite strange.  The &lt;CODE&gt;rex&lt;/CODE&gt; works just fine for me on some mocked up data.  It is possible that there is some invisible/nonprintable control character in your search causing the problem.  First, copy the entire search to notepad, verify that it is plain text, then ctrl-a ctrl-v to paste it back into splunk and submit the search again.  If you get the same error, then proceed with these triage steps...&lt;/P&gt;

&lt;P&gt;Okay, here's some triage steps.  First, do this and check to see that there is a &lt;CODE&gt;_raw&lt;/CODE&gt; field in the output...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=security source="/data/*/vpn" IP=192.168.206.176 OR outerIP=192.168.206.176 | head 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Next, add just this line after the above.  Copy and paste it from here...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "IP=(?&amp;lt;VPN_IP&amp;gt;[^\s]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If that causes an error, then please post the exact wording of the error, and a non-confidential version of the _raw.  If there is no error, then add this line and run again...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "outerIP=(?&amp;lt;clientIP&amp;gt;[^\s]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If there is no error yet, then let us know and we can try to determine what was wrong with the &lt;CODE&gt;rex&lt;/CODE&gt;.  If the error does crop up, then when it appears, we will have more information.&lt;/P&gt;</description>
    <pubDate>Wed, 31 May 2017 04:12:47 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-05-31T04:12:47Z</dc:date>
    <item>
      <title>rex invalid argument</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-invalid-argument/m-p/323614#M4582</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We're using 6.5.3.  Got error "Error in 'rex' command: Invalid argument: ' ' "   for query like following:&lt;/P&gt;

&lt;HR /&gt;

&lt;PRE&gt;&lt;CODE&gt;index=security source="/data/*/vpn" IP=192.168.206.176 OR outerIP=192.168.206.176
            | rex field=_raw "IP=(?&amp;lt;VPN_IP&amp;gt;[^\s]*).*DN:.*outerIP=(?&amp;lt;clientIP&amp;gt;[^\s]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;I tried to replace with a simpler expression like &lt;CODE&gt;"^(?&amp;lt;EveryThing&amp;gt;.*)$"&lt;/CODE&gt; but also get the same error.&lt;BR /&gt;&lt;BR /&gt;
Would anyone please help?   Sorry for the newbie question.&lt;/P&gt;

&lt;P&gt;Thanks and regards&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 03:26:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-invalid-argument/m-p/323614#M4582</guid>
      <dc:creator>stwong</dc:creator>
      <dc:date>2017-05-31T03:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: rex invalid argument</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-invalid-argument/m-p/323615#M4583</link>
      <description>&lt;P&gt;Interesting.   It is not you, it is something quite strange.  The &lt;CODE&gt;rex&lt;/CODE&gt; works just fine for me on some mocked up data.  It is possible that there is some invisible/nonprintable control character in your search causing the problem.  First, copy the entire search to notepad, verify that it is plain text, then ctrl-a ctrl-v to paste it back into splunk and submit the search again.  If you get the same error, then proceed with these triage steps...&lt;/P&gt;

&lt;P&gt;Okay, here's some triage steps.  First, do this and check to see that there is a &lt;CODE&gt;_raw&lt;/CODE&gt; field in the output...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=security source="/data/*/vpn" IP=192.168.206.176 OR outerIP=192.168.206.176 | head 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Next, add just this line after the above.  Copy and paste it from here...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "IP=(?&amp;lt;VPN_IP&amp;gt;[^\s]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If that causes an error, then please post the exact wording of the error, and a non-confidential version of the _raw.  If there is no error, then add this line and run again...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "outerIP=(?&amp;lt;clientIP&amp;gt;[^\s]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If there is no error yet, then let us know and we can try to determine what was wrong with the &lt;CODE&gt;rex&lt;/CODE&gt;.  If the error does crop up, then when it appears, we will have more information.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 04:12:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-invalid-argument/m-p/323615#M4583</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-31T04:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: rex invalid argument</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-invalid-argument/m-p/323616#M4584</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Thanks a lot.&lt;BR /&gt;&lt;BR /&gt;
Right, probably some invisible characters embedded as I copied the query from an app installed.&lt;BR /&gt;
It works if I typed it from scratch.&lt;/P&gt;

&lt;P&gt;Thanks again.&lt;BR /&gt;
Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 03:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-invalid-argument/m-p/323616#M4584</guid>
      <dc:creator>stwong</dc:creator>
      <dc:date>2017-06-01T03:12:51Z</dc:date>
    </item>
  </channel>
</rss>

