<?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: Help need to fix error &amp;quot;The expression is malformed. Expected LIKE.&amp;quot;  (Using rex and inputlookup) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403126#M116637</link>
    <description>&lt;P&gt;Use btool.  On the CLI, run &lt;CODE&gt;$SPLUNK_HOME/bin/splunk btool -debug props list pan:threat&lt;/CODE&gt;.  It will show the file(s) from which the attributes came.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Aug 2018 13:04:58 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2018-08-15T13:04:58Z</dc:date>
    <item>
      <title>Help need to fix error "The expression is malformed. Expected LIKE."  (Using rex and inputlookup)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403121#M116632</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I am looking for some help on how to remove the malformed expression error coming from the query below, many thanks for your time:&lt;/P&gt;

&lt;P&gt;index="test"  Policies=policy1 Destination=&lt;EM&gt;@&lt;/EM&gt;&lt;BR /&gt;
| rex max_match=0 field=Destination  "(?[^@]+)@(?[^,\"\s\;]+)" &lt;BR /&gt;
| search Comp [| inputlookup test.csv | fields suspicious]&lt;BR /&gt;
| table ref Comp date_month&lt;/P&gt;

&lt;P&gt;The test.csv has 'app' permissions and |inputlookup test.csv shows the data from the csv.&lt;BR /&gt;
The rex command works without the search (it extracts domains from email addresses)&lt;/P&gt;

&lt;P&gt;Job inspector has a comment of&lt;BR /&gt;
info : No matching fields exist&lt;/P&gt;

&lt;P&gt;Job search has this line:&lt;BR /&gt;
WARN  CalcFieldProcessor - Invalid eval expression for 'EVAL-url_length' in stanza [pan:threat]: The expression is malformed. Expected LIKE.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403121#M116632</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2020-09-29T20:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help need to fix error "The expression is malformed. Expected LIKE."  (Using rex and inputlookup)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403122#M116633</link>
      <description>&lt;P&gt;For some reason the wildcards around the @ were removed when copied over the query.  It should be Destination=&lt;EM&gt;@&lt;/EM&gt; , basically it is looking for emails.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 09:38:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403122#M116633</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2018-08-15T09:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help need to fix error "The expression is malformed. Expected LIKE."  (Using rex and inputlookup)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403123#M116634</link>
      <description>&lt;P&gt;To keep that from happening, put backticks around your code or highlight the lines and press the Code button ("101010").&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 10:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403123#M116634</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-08-15T10:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help need to fix error "The expression is malformed. Expected LIKE."  (Using rex and inputlookup)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403124#M116635</link>
      <description>&lt;P&gt;The error is not coming from your query, at least not directly.  It's caused by a faulty auto-calculated field "url_length".  If you can share the &lt;CODE&gt;pan:threat&lt;/CODE&gt; stanza from your props.conf file we may be able to say how to correct it.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 10:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403124#M116635</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-08-15T10:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help need to fix error "The expression is malformed. Expected LIKE."  (Using rex and inputlookup)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403125#M116636</link>
      <description>&lt;P&gt;thank you for the reply, would you happen to know which folder to get it from?  I can find over 20 &lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 10:54:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403125#M116636</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2018-08-15T10:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help need to fix error "The expression is malformed. Expected LIKE."  (Using rex and inputlookup)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403126#M116637</link>
      <description>&lt;P&gt;Use btool.  On the CLI, run &lt;CODE&gt;$SPLUNK_HOME/bin/splunk btool -debug props list pan:threat&lt;/CODE&gt;.  It will show the file(s) from which the attributes came.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 13:04:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403126#M116637</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-08-15T13:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help need to fix error "The expression is malformed. Expected LIKE."  (Using rex and inputlookup)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403127#M116638</link>
      <description>&lt;P&gt;Hi ChrisCLewis,&lt;BR /&gt;
what's "Comp"?&lt;BR /&gt;
if you want to use a lookup in a subsearch you have to put attention that the field name of the subsearch is the same of the main search, so if in the main search you have a field called suspicious, you can use a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="test" Policies=policy1 Destination=@
| rex max_match=0 field=Destination "(?[^@]+)@(?[^,\"\s\;]+)" 
| search [ | inputlookup test.csv | fields suspicious ]
| table ref Comp date_month
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if instead the field name in the main search is different (e.g. Comp), you have to rename field in the subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="test" Policies=policy1 Destination=@
| rex max_match=0 field=Destination "(?[^@]+)@(?[^,\"\s\;]+)" 
| search [ | inputlookup test.csv | rename suspicious AS Comp | fields Comp ]
| table ref Comp date_month
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In other words in main search and in subsearch you must have the same field name.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 17:05:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403127#M116638</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-08-15T17:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help need to fix error "The expression is malformed. Expected LIKE."  (Using rex and inputlookup)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403128#M116639</link>
      <description>&lt;P&gt;Thank you for your help the issues are being caused by not being able to grant the App permission to read the Lookup file &amp;amp; Lookup definitions&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 13:53:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-need-to-fix-error-quot-The-expression-is-malformed-Expected/m-p/403128#M116639</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2018-08-23T13:53:31Z</dc:date>
    </item>
  </channel>
</rss>

