<?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: Using a lookup file to run queries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-to-run-queries/m-p/362783#M169986</link>
    <description>&lt;P&gt;Do the error messages appean on specific place in your raw data? If yes, you could setup field extraction for it.&lt;/P&gt;

&lt;P&gt;Your other option would to 1) Add wildcard asterist &lt;CODE&gt;*&lt;/CODE&gt;at either side of values of column Error in the lookup ErrorString.csv, 2) setup a lookup definition with wildcard match for your ErrorString.csv, 3) use &lt;CODE&gt;lookup&lt;/CODE&gt; command using that lookup definition to match _raw and output Error Column, on which you should be able to do stats/timechart (after cleaning up &lt;CODE&gt;*&lt;/CODE&gt;)&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html"&gt;https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Apr 2018 20:16:08 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-04-25T20:16:08Z</dc:date>
    <item>
      <title>Using a lookup file to run queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-to-run-queries/m-p/362782#M169985</link>
      <description>&lt;P&gt;I'm trying to create a search based on error strings in a lookup  file and i'd like the output to include stats based on the individual strings in the lookup file.&lt;/P&gt;

&lt;P&gt;The following query works where I can search for all the query strings but i'm unable to create fields based on the Error so that I can use it in a stats or timechart query&lt;/P&gt;

&lt;P&gt;index=syslogs [| inputlookup ErrorString.csv | table Error | rename Error as search | format] &lt;/P&gt;

&lt;P&gt;Example ErrorString.csv with a header of Error and the logs strings below&lt;/P&gt;

&lt;P&gt;Error&lt;BR /&gt;
Invalid response from hook&lt;BR /&gt;
com.atlassian.applinks.api.CredentialsRequiredException&lt;BR /&gt;
response com.atlassian.sal.api.net.ResponseStatusException: Unexpected response received&lt;BR /&gt;
ORA-00001: unique constraint * violated&lt;BR /&gt;
SqlExceptionHelper bitbucket - Connection is not available, request timed out&lt;BR /&gt;
JDBCConnectionException: Could not open connection&lt;BR /&gt;
SqlExceptionHelper bitbucket - Connection is not available&lt;BR /&gt;
org.hibernate.exception.JDBCConnectionException: Could not open connection&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 19:21:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-to-run-queries/m-p/362782#M169985</guid>
      <dc:creator>gferreira</dc:creator>
      <dc:date>2018-04-25T19:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup file to run queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-to-run-queries/m-p/362783#M169986</link>
      <description>&lt;P&gt;Do the error messages appean on specific place in your raw data? If yes, you could setup field extraction for it.&lt;/P&gt;

&lt;P&gt;Your other option would to 1) Add wildcard asterist &lt;CODE&gt;*&lt;/CODE&gt;at either side of values of column Error in the lookup ErrorString.csv, 2) setup a lookup definition with wildcard match for your ErrorString.csv, 3) use &lt;CODE&gt;lookup&lt;/CODE&gt; command using that lookup definition to match _raw and output Error Column, on which you should be able to do stats/timechart (after cleaning up &lt;CODE&gt;*&lt;/CODE&gt;)&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html"&gt;https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 20:16:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-to-run-queries/m-p/362783#M169986</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-25T20:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup file to run queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-to-run-queries/m-p/362784#M169987</link>
      <description>&lt;P&gt;I've confronted issues like this before, and it's not totally straightforward. If the strings you're searching for all fall into the same field in the base events, you have a shot. First, you'll need to either change your existing lookup table into a wildcard lookup or duplicate your lookup table so you have two - your current table and another that is a wildcard lookup. Then you'd do something like this, assuming your error strings all appear in a field called &lt;CODE&gt;message&lt;/CODE&gt;, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=syslogs 
    [| inputlookup ErrorString.csv 
    | table Error 
    | rename Error AS search 
    | format ] 
| lookup ErrorStringWildcard.csv Error AS message OUTPUT Error AS matching_Error 
| eval matching_Error=trim(matching_Error, "*")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A few major gotchas: &lt;BR /&gt;
1. The lookup will be case-sensitive, so an event with &lt;CODE&gt;"INVALID response from hook"&lt;/CODE&gt; will not match a wildcard lookup entry of &lt;CODE&gt;"*Invalid response from hook*"&lt;/CODE&gt;. (There are some ways to get around this by making your lookup case-insensitive and having all of your wildcard lookup entries be in lower-case.)&lt;BR /&gt;
2. This won't work if the Error string can appear in multiple fields. If that's the case, you'll need to either use coalesce to get them into a single field or run the lookup many times over multiple field names.&lt;BR /&gt;
3. This really won't work well if the Error string can appear in the _raw data and isn't being extracted into a field.&lt;/P&gt;

&lt;P&gt;If you've never set up a wildcard lookup before, this is a good guide:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html"&gt;https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 20:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-to-run-queries/m-p/362784#M169987</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-25T20:19:34Z</dc:date>
    </item>
  </channel>
</rss>

