<?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: Error on using eval in a subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9470#M138</link>
    <description>&lt;P&gt;Ah, yes. Quoting of double-quote characters and backslashes inside of rex strings is going to be confusing and problematic. I'd advise you if you're doing this to put the regexes into props.conf/transforms.conf and use the "extract" command to call them. If they're in the file, you can use plain PCRE syntax without worrying about how they might get transformed and passed inside the string.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jan 2010 04:18:38 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-01-24T04:18:38Z</dc:date>
    <item>
      <title>Error on using eval in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9467#M135</link>
      <description>&lt;P&gt;What is wrong with the way I'm using eval here?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/some.audit.log" "End" "/foo/baz"
| rex field=_raw "(?P&amp;lt;ReqId&amp;gt;\bREQ\w{32}\b)"
| rex field=_raw "(?P&amp;lt;IpAddress&amp;gt;\b[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\b)"
| rex field=_raw "(?i) End \"(?P&amp;lt;Lid&amp;gt;[^\"]*)\""
| rex field=_raw "[^ ] (?P&amp;lt;HostName&amp;gt;\w+\.\w+\.\w+) [^ ]"
| fields ReqId, Lid, HostName, IpAddress
| join ReqId [search
source="/some.error.log" "Fail" "BLOCK"
| rex field=_raw "(?P&amp;lt;ReqId&amp;gt;\bREQ\w{32}\b)"
| rex field=_raw "Status (?P&amp;lt;Status&amp;gt;\b\w*\b)"
| eval raw1=_raw
| fields ReqId, Status, raw1
]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I got this error message&lt;/P&gt;

&lt;P&gt;Error in 'eval' command: Failed to parse arguments. eval usage: eval dest_key = expression&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2010 08:27:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9467#M135</guid>
      <dc:creator>dinh</dc:creator>
      <dc:date>2010-01-23T08:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using eval in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9468#M136</link>
      <description>&lt;P&gt;Just trying to pull a few of the rex out, it looks like something in this line is causing it but I'm not sure what.&lt;/P&gt;

&lt;P&gt;| rex field=_raw "(?i) End \"(?P&lt;LID&gt;[^\"]*)\""&lt;/LID&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2010 08:47:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9468#M136</guid>
      <dc:creator>dinh</dc:creator>
      <dc:date>2010-01-23T08:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using eval in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9469#M137</link>
      <description>&lt;P&gt;turns out this was the problem: [^\"]*&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2010 08:50:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9469#M137</guid>
      <dc:creator>dinh</dc:creator>
      <dc:date>2010-01-23T08:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using eval in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9470#M138</link>
      <description>&lt;P&gt;Ah, yes. Quoting of double-quote characters and backslashes inside of rex strings is going to be confusing and problematic. I'd advise you if you're doing this to put the regexes into props.conf/transforms.conf and use the "extract" command to call them. If they're in the file, you can use plain PCRE syntax without worrying about how they might get transformed and passed inside the string.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2010 04:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9470#M138</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-01-24T04:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using eval in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9471#M139</link>
      <description>&lt;P&gt;Where can I find the documentation on how to implement it this way?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2010 07:54:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9471#M139</guid>
      <dc:creator>dinh</dc:creator>
      <dc:date>2010-01-25T07:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using eval in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9472#M140</link>
      <description>&lt;P&gt;The "extract" command docs and the docs for the transforms.conf file should do it. You define it in transforms.conf, then call it on demand using the "extract" command (instead of "rex"). You could use props.conf to make it run automatically for the sourcetype as well.&lt;/P&gt;

&lt;P&gt;BTW I would not use macros.conf for this particular case, since it adds a whole new layer of escaping and parsing.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2010 09:20:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-on-using-eval-in-a-subsearch/m-p/9472#M140</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-01-27T09:20:10Z</dc:date>
    </item>
  </channel>
</rss>

