<?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 Comparing logs with inputlookup files in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381217#M6179</link>
    <description>&lt;P&gt;Hey all,&lt;/P&gt;

&lt;P&gt;I have a fairly simple question.&lt;/P&gt;

&lt;P&gt;I have a web proxy index that has a url field.&lt;/P&gt;

&lt;P&gt;I have a CSV that contains malicious TLD's (.ru, .cn).&lt;/P&gt;

&lt;P&gt;I'm trying to create the right query to match the CSV to this field in the web proxy index ?&lt;BR /&gt;
So if traffic is seen for url=hackingsite.ru, that it gets compared to the CSV and sees that a .ru domain is bad (so it matches).&lt;/P&gt;

&lt;P&gt;index=webproxy [|inputlookup MalciousDNSTLD.csv | fields dns] | eval dns=url | table url&lt;/P&gt;

&lt;P&gt;But, I know I am missing something from the query, looking for some generous help.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2019 23:30:50 GMT</pubDate>
    <dc:creator>harrysof</dc:creator>
    <dc:date>2019-05-17T23:30:50Z</dc:date>
    <item>
      <title>Comparing logs with inputlookup files</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381217#M6179</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;

&lt;P&gt;I have a fairly simple question.&lt;/P&gt;

&lt;P&gt;I have a web proxy index that has a url field.&lt;/P&gt;

&lt;P&gt;I have a CSV that contains malicious TLD's (.ru, .cn).&lt;/P&gt;

&lt;P&gt;I'm trying to create the right query to match the CSV to this field in the web proxy index ?&lt;BR /&gt;
So if traffic is seen for url=hackingsite.ru, that it gets compared to the CSV and sees that a .ru domain is bad (so it matches).&lt;/P&gt;

&lt;P&gt;index=webproxy [|inputlookup MalciousDNSTLD.csv | fields dns] | eval dns=url | table url&lt;/P&gt;

&lt;P&gt;But, I know I am missing something from the query, looking for some generous help.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 23:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381217#M6179</guid>
      <dc:creator>harrysof</dc:creator>
      <dc:date>2019-05-17T23:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing logs with inputlookup files</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381218#M6180</link>
      <description>&lt;P&gt;Still many people try to use &lt;CODE&gt;| inputlookup&lt;/CODE&gt; when it's not needed. What you rather want to use is &lt;CODE&gt;| lookup&lt;/CODE&gt; which maps to your use case perfectly. Be sure to have a lookup definition because usually you don't call lookups by "lookup.csv" but by it's lookup definition name (stanza name). &lt;BR /&gt;
Will be something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=webproxy
| lookup MalciousDNSTLD field1 AS field2 OUTPUT field2 as field2
| where isnull(field2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;.. or &lt;CODE&gt;isnotnull()&lt;/CODE&gt; depending what you want (is in the badurls list or isn't.&lt;BR /&gt;
Look at the &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/lookup"&gt;docs&lt;/A&gt; for a description of which field to use where. It's rather simple. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Skalli&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2019 13:23:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381218#M6180</guid>
      <dc:creator>skalliger</dc:creator>
      <dc:date>2019-05-18T13:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing logs with inputlookup files</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381219#M6181</link>
      <description>&lt;P&gt;@harrysof depends on what is the value of &lt;CODE&gt;url&lt;/CODE&gt; field in the webproxy index and what is the value of dns in the TLD csv file?&lt;/P&gt;

&lt;P&gt;Based on the description seems like TLD csv only has TLD info like .ru or .cn. What are you matching this against in the index?&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2019 13:58:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381219#M6181</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-05-18T13:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing logs with inputlookup files</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381220#M6182</link>
      <description>&lt;P&gt;Consider also making the lookup values wildcard match type.&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 17:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381220#M6182</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2019-05-20T17:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing logs with inputlookup files</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381221#M6183</link>
      <description>&lt;P&gt;First, install &lt;CODE&gt;URL toolbox&lt;/CODE&gt;:&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/2734/"&gt;https://splunkbase.splunk.com/app/2734/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Then do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=webproxy
| lookup ut_parse_extended_lookup url
| rex field=ut_domain "\.(&amp;lt;tld&amp;gt;[^\.]+)$"
| lookup MalciousDNSTLD.csv dns AS tld OUTPUT dns AS malicious
| where isnotnull(malicious)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 Jul 2019 18:40:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Comparing-logs-with-inputlookup-files/m-p/381221#M6183</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-06T18:40:40Z</dc:date>
    </item>
  </channel>
</rss>

