<?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: Escaping (*) in Fieldvalues while inputlookup in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302082#M7118</link>
    <description>&lt;P&gt;@blacknight659&lt;/P&gt;

&lt;P&gt;This doesn't work because the string will no longer match and the results won't be filtered out.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 19:18:55 GMT</pubDate>
    <dc:creator>twjack</dc:creator>
    <dc:date>2017-10-10T19:18:55Z</dc:date>
    <item>
      <title>Escaping (*) in Fieldvalues while inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302076#M7112</link>
      <description>&lt;P&gt;Hello everyone, I have the following problem.&lt;/P&gt;

&lt;P&gt;My Inputlookup (a whiltelist) has the following data structure:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host,dest_host,Host_Application
host1, dest_Host1,Host_Application1
host2, dest_Host2,Host_*2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My inputlookup is structured as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOT 
    [| inputlookup something2exclude.csv 
    | table * ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The normalized search looks good for the first row (host1):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(host=host1 AND dest_Host=dest_Host1 AND Host_Application=Host_Application1)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But, for the second row I get an error message:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;...contains a wildcard in the middle of a word or string. This might cause inconsistent results if the characters that the wildcard represents include punctuation.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;How can I exclude the asterisk as fieldvalue while inputlookup?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 12:59:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302076#M7112</guid>
      <dc:creator>twjack</dc:creator>
      <dc:date>2017-10-10T12:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping (*) in Fieldvalues while inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302077#M7113</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/69126"&gt;@twjack&lt;/a&gt;&lt;BR /&gt;
try this,&lt;/P&gt;

&lt;P&gt;| inputlookup something.csv | eval Host_Application=replace(Host_Application,"\*","#") | rest of your search&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:13:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302077#M7113</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T16:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping (*) in Fieldvalues while inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302078#M7114</link>
      <description>&lt;P&gt;Here is an example of the original field content that should not appear in the search results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"C:\Windows\SYSNATIVE\WINDOW~1\v1.0\powershell.exe -command stop-process -processname DeployControlFullScanSCEP* -force".
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All results with the following combination should no longer be present in the search results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Host_Application="C:\Windows\SYSNATIVE\WINDOW~1\v1.0\powershell.exe -command stop-process -processname DeployControlFullScanSCEP* -force"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I replace the asterisk with "#" then Splunk will not find the string and will not remove the results. In a search, I'd put it this way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Host_Application!="C: \Windows\SYSNATIVE\WINDOW~1\v1.0\powershell.exe -command stop-process -process name DeployControlFullScanSCEP* -force".
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or even&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOT Host_Application="C: \Windows\SYSNATIVE\WINDOW~1\v1.0\powershell.exe -command stop-process -processname DeployControlFullScanSCEP* -force".
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Technically my variant listed below works, the results are filtered but Splunk complains about the asterisk.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOT
    [| inputlookup something2exclude.csv 
    table *] 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:18:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302078#M7114</guid>
      <dc:creator>twjack</dc:creator>
      <dc:date>2017-10-10T15:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping (*) in Fieldvalues while inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302079#M7115</link>
      <description>&lt;P&gt;If you don't follow the Eval from @twjack, I would extract the value and remove the "*". &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOT
[| inputlookup something.csv | fields host, dest_host, Host_Application]
| rex field=Host_Application "*(?&amp;lt;Host_ApplicationNew&amp;gt;[a-zA-Z]*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:42:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302079#M7115</guid>
      <dc:creator>blacknight659</dc:creator>
      <dc:date>2017-10-10T15:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping (*) in Fieldvalues while inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302080#M7116</link>
      <description>&lt;P&gt;To make it easier to understand and avoid confusion.&lt;/P&gt;

&lt;P&gt;Assuming I have these kind of log entries:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-10-10 10:53  &amp;lt;dest_host = dest_host2.domain.com&amp;gt; &amp;lt;Host_Application = C: \Windows\SYSNATIVE\WINDOW~1\v1.0\powershell. exe -command stop-process -process name DeployControlFullScanSCEP*&amp;gt;
-force&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-10-10 10:55  &amp;lt;dest_host = dest_host1.domain.com&amp;gt; &amp;lt;Host_Application = C: \Windows\SYSNATIVE\WINDOW~1\v1.0\powershell. exe&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and a lookupfile called exclude.csv with the following structure:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host, dest_host, Host_Application
host1, dest_host1.domain.com, C:\Windows\SYSNATIVE\WINDOW~1\v1.0\powershell.exe
host2, dest_host2.domain.com, C:\Windows\SYSNATIVE\WINDOW~1\v1.0\powershell.exe -command stop-process -processname DeployControlFullScanSCEP* -force
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To test my whitelisting I narrow down the results with the following search to get only these events.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=powershell Host_Application="C:\\Windows\\SYSNATIVE\\WINDOW~1\\v1.0\\powershell.exe -command stop-process -processname DeployControlFullScanSCEP* -force" OR Host_Application="C:\\Windows\\SYSNATIVE\\WINDOW~1\\v1.0\\powershell.exe"
| table host dest_host Host_Application
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the correct table:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host, dest_host, Host_Application
host1, dest_host1.domain.com, C:\Windows\SYSNATIVE\WINDOW~1\v1.0\powershell.exe
host2, dest_host2.domain.com, C:\Windows\SYSNATIVE\WINDOW~1\v1.0\powershell.exe -command stop-process -processname DeployControlFullScanSCEP* -force
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now it's time to make this result disappear through a inputlookup and see if the whitelisting works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=powershell Host_Application="C:\\Windows\\SYSNATIVE\\WINDOW~1\\v1.0\\powershell.exe -command stop-process -processname DeployControlFullScanSCEP* -force" OR Host_Application="C:\\Windows\\SYSNATIVE\\WINDOW~1\\v1.0\\powershell.exe" NOT 
    [| inputlookup exclude.csv | table * ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works but Splunk complains about the asterisk:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;...contains a wildcard in the middle&lt;BR /&gt;
of a word or string. This might cause&lt;BR /&gt;
inconsistent results if the characters&lt;BR /&gt;
that the wildcard represents include&lt;BR /&gt;
punctuation.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I just can't figure out a solution that would satisfy Splunk. I hope that I was able to express my challenge more clearly.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 17:15:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302080#M7116</guid>
      <dc:creator>twjack</dc:creator>
      <dc:date>2017-10-10T17:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping (*) in Fieldvalues while inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302081#M7117</link>
      <description>&lt;P&gt;Ok, how about this crazy idea.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup exclude.csv
| eval Host_Application=replace(Host_Application,"\*","#") 
| outputlookup exclude2.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then change the .csv from your original search to the new one. &lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 18:46:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302081#M7117</guid>
      <dc:creator>blacknight659</dc:creator>
      <dc:date>2017-10-10T18:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping (*) in Fieldvalues while inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302082#M7118</link>
      <description>&lt;P&gt;@blacknight659&lt;/P&gt;

&lt;P&gt;This doesn't work because the string will no longer match and the results won't be filtered out.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 19:18:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Escaping-in-Fieldvalues-while-inputlookup/m-p/302082#M7118</guid>
      <dc:creator>twjack</dc:creator>
      <dc:date>2017-10-10T19:18:55Z</dc:date>
    </item>
  </channel>
</rss>

