<?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: How to lookup value with wildcard? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364848#M107614</link>
    <description>&lt;P&gt;Is the lookup only used as a list of things to search for? If yes, you can try using a query like this instead&lt;BR /&gt;
&lt;CODE&gt;sourcetype=sudo [| inputlookup suspicious_commands ]  | stats count by host _time src_user src TTY PWD USER dest COMMAND action | sort - _time&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Apr 2018 13:32:16 GMT</pubDate>
    <dc:creator>janispelss</dc:creator>
    <dc:date>2018-04-26T13:32:16Z</dc:date>
    <item>
      <title>How to lookup value with wildcard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364846#M107612</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;
for example, i have that log:&lt;BR /&gt;
&lt;CODE&gt;Apr 26 12:04:38 centos7LAB sudo:  qweqwe : TTY=pts/4 ; PWD=/home/qweqwe ; USER=root ; COMMAND=/bin/chmod +x 436346&lt;/CODE&gt;&lt;BR /&gt;
and i want to make filter by command by lookup&lt;BR /&gt;
kinda &lt;CODE&gt;sourcetype=sudo | stats count by host _time src_user src TTY PWD USER dest COMMAND action | lookup suspicious_commands COMMAND AS COMMAND OUTPUT COMMAND AS COMMAND | where COMMAND!=""  | sort - _time&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I used &lt;CODE&gt;match_type = WILDCARD(COMMAND)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;my lookup look like it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;COMMAND
*chmod*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Open my screenshot and instead of &lt;CODE&gt;*chmod*&lt;/CODE&gt; I want see &lt;CODE&gt;/bin/chmod +x 436346&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Or what you know other solutions to make what I want?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 10:44:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364846#M107612</guid>
      <dc:creator>test_qweqwe</dc:creator>
      <dc:date>2018-04-26T10:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup value with wildcard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364847#M107613</link>
      <description>&lt;P&gt;Do&lt;BR /&gt;
&lt;CODE&gt;lookup suspicious_commands COMMAND OUTPUT COMMAND AS cmd_match | where isnotnull(cmd_match) | fields - cmd_match&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 12:41:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364847#M107613</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2018-04-26T12:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup value with wildcard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364848#M107614</link>
      <description>&lt;P&gt;Is the lookup only used as a list of things to search for? If yes, you can try using a query like this instead&lt;BR /&gt;
&lt;CODE&gt;sourcetype=sudo [| inputlookup suspicious_commands ]  | stats count by host _time src_user src TTY PWD USER dest COMMAND action | sort - _time&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 13:32:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364848#M107614</guid>
      <dc:creator>janispelss</dc:creator>
      <dc:date>2018-04-26T13:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup value with wildcard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364849#M107615</link>
      <description>&lt;P&gt;It works, too!&lt;BR /&gt;
Explain me what you did.&lt;BR /&gt;
I mean:&lt;BR /&gt;
lookup suspicious_commands &lt;CODE&gt;COMMAND OUTPUT COMMAND AS cmd_match&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:16:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364849#M107615</guid>
      <dc:creator>test_qweqwe</dc:creator>
      <dc:date>2020-09-29T19:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup value with wildcard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364850#M107616</link>
      <description>&lt;P&gt;It works! Thank you!&lt;BR /&gt;
Will be nice if you will explain a bit why it works, cause i have some triggers in my head.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 14:34:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364850#M107616</guid>
      <dc:creator>test_qweqwe</dc:creator>
      <dc:date>2018-04-26T14:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup value with wildcard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364851#M107617</link>
      <description>&lt;P&gt;If this isnt going to be a large lookup then yes the inputlookup pattern works. I tend to stick with the normal lookup pattern. Your original search stomped the original command field. This just outputs the field you matched on to it's own name then looks for where it is not null. AKA found a match.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 19:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364851#M107617</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2018-04-26T19:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup value with wildcard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364852#M107618</link>
      <description>&lt;P&gt;So when a subsearch is used in a search command (and the search command is by default the first command of a query), the subsearch expands it's results into additional search terms, where the fields of a row/event are combined with "AND" and multiple rows/events are combined with "OR".&lt;/P&gt;

&lt;P&gt;So if you have a lookup like &lt;BR /&gt;
    COMMAND&lt;BR /&gt;
    *chmod*&lt;BR /&gt;
    *chown*&lt;/P&gt;

&lt;P&gt;then &lt;CODE&gt;[| inputlookup suspicious_commands]&lt;/CODE&gt; will expand into &lt;CODE&gt;( (COMMAND="*chmod*") OR (COMMAND="*chown*") )&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;You can actually see what exactly something would expand to by using the &lt;CODE&gt;format&lt;/CODE&gt; command, like &lt;CODE&gt;| inputlookup suspicious_commands| format&lt;/CODE&gt;. And you can use pretty much anything for the subsearch, not just lookups.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 05:46:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-value-with-wildcard/m-p/364852#M107618</guid>
      <dc:creator>janispelss</dc:creator>
      <dc:date>2018-04-27T05:46:57Z</dc:date>
    </item>
  </channel>
</rss>

