<?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 in subsearch to derive new field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216678#M63603</link>
    <description>&lt;P&gt;Yes it has white spaces&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2016 13:02:38 GMT</pubDate>
    <dc:creator>sr_dhinesh</dc:creator>
    <dc:date>2016-06-22T13:02:38Z</dc:date>
    <item>
      <title>Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216675#M63600</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=xyz [|inputlookup error_strings  | table string | rename string as search | format]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the lookup I have a list of string "error", "nullvalue",... etc&lt;/P&gt;

&lt;P&gt;In the index xyz I have multiline events and have multiple strings, but not in a proper format to extract fields.&lt;/P&gt;

&lt;P&gt;My requirement is whenever there is a string that matches to the lookup file in the event, I want the distinct count of the string. (Disclaimer: I do not have those strings in field as it cannot be extracted as they are uneven and each event has 240 lines.. these are java exceptions and errors)&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 12:10:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216675#M63600</guid>
      <dc:creator>sr_dhinesh</dc:creator>
      <dc:date>2016-06-22T12:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216676#M63601</link>
      <description>&lt;P&gt;Is there any whitespace in your list of strings ? Are your strings single words? eg just "error" or "nullvalue". Or are there strings like "threw exception" ?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 12:29:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216676#M63601</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-06-22T12:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216677#M63602</link>
      <description>&lt;P&gt;Yes it has spaces Below are the strings:&lt;/P&gt;

&lt;P&gt;java.lang.OutOfMemoryError&lt;BR /&gt;
Unable to send alert because queue is full&lt;BR /&gt;
ContainerConfigPollingService Exception&lt;BR /&gt;
java.lang.NullPointerException&lt;BR /&gt;
com.digev.fw.exception.GException: Internal system error.&lt;BR /&gt;
com.digev.fw.exception.GException: Unexpected error&lt;BR /&gt;
com.digev.fw.exception.GException: Error occured while validating token null&lt;BR /&gt;
com.digev.fw.exception.GException: Unrecognized echange pattern&lt;/P&gt;

&lt;P&gt;The query that i mentioned on top gives me  the events with these string however i am not able to get a count of those distinct strings, Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 12:34:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216677#M63602</guid>
      <dc:creator>sr_dhinesh</dc:creator>
      <dc:date>2016-06-22T12:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216678#M63603</link>
      <description>&lt;P&gt;Yes it has white spaces&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 13:02:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216678#M63603</guid>
      <dc:creator>sr_dhinesh</dc:creator>
      <dc:date>2016-06-22T13:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216679#M63604</link>
      <description>&lt;P&gt;How many strings are we talking about? If its not too many you could  basically do a separate search for each string.  &lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 13:10:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216679#M63604</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-06-22T13:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216680#M63605</link>
      <description>&lt;P&gt;for now there are 10 strings but client might want to modify the lookup as and when required, so that s going to be hard&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 13:32:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216680#M63605</guid>
      <dc:creator>sr_dhinesh</dc:creator>
      <dc:date>2016-06-22T13:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216681#M63606</link>
      <description>&lt;P&gt;Can a value from lookup appear in the event multiple times? If yes, should they be counted as one ?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 14:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216681#M63606</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-22T14:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216682#M63607</link>
      <description>&lt;P&gt;I don't think Splunk is really the tool for this - you might be better off with some python or R package against the raw data if you want to do this in a scalable way&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 14:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216682#M63607</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-06-22T14:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216683#M63608</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup error_strings | table string  | map maxsearches=20 search="search index=xyz  $string$ | stats count"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2016 15:21:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216683#M63608</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-22T15:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216684#M63609</link>
      <description>&lt;P&gt;Let us assume that your lookup file has more than 1 field and that one of the other unique fields is called &lt;CODE&gt;error_code&lt;/CODE&gt;.  You need to make your lookup a &lt;CODE&gt;WILDCARD&lt;/CODE&gt; lookup on field &lt;CODE&gt;string&lt;/CODE&gt; and add an asterisk ( &lt;CODE&gt;*&lt;/CODE&gt; ) as both the first and last character of every string.  Then do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz [|inputlookup error_strings | table string | rename string AS query] | lookup error_strings string AS _raw OUTPUT error_code
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then either this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count BY error_code
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats dc(error_code) values(error_code)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, if you like, you can invert the lookup call to convert the &lt;CODE&gt;error_code&lt;/CODE&gt; back to &lt;CODE&gt;string&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 15:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216684#M63609</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-22T15:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216685#M63610</link>
      <description>&lt;P&gt;Great solution&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 15:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216685#M63610</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-06-22T15:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216686#M63611</link>
      <description>&lt;P&gt;i created another column in lookup as error_code and what value do you want me to insert here, is it the string value and convert the string value to asterik error asterik ?&lt;/P&gt;

&lt;P&gt;Is this correct&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 16:04:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216686#M63611</guid>
      <dc:creator>sr_dhinesh</dc:creator>
      <dc:date>2016-06-22T16:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216687#M63612</link>
      <description>&lt;P&gt;this gives some count only error !!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 16:11:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216687#M63612</guid>
      <dc:creator>sr_dhinesh</dc:creator>
      <dc:date>2016-06-22T16:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216688#M63613</link>
      <description>&lt;P&gt;You can put any unique string there.  The simplest thing is to copy the &lt;CODE&gt;string&lt;/CODE&gt; value, (without the asterisks).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 16:24:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216688#M63613</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-22T16:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216689#M63614</link>
      <description>&lt;P&gt;Be sure to upvote!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 17:54:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216689#M63614</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-22T17:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216690#M63615</link>
      <description>&lt;P&gt;You have plenty of karma as it is &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 08:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216690#M63615</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-06-23T08:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216691#M63616</link>
      <description>&lt;P&gt;But I am almost passing @duckfez (maybe today)!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 14:22:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216691#M63616</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-23T14:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216692#M63617</link>
      <description>&lt;P&gt;lol so close!&lt;/P&gt;

&lt;P&gt;Just keep me ahead of @Jeremiah&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 15:19:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216692#M63617</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-06-23T15:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216693#M63618</link>
      <description>&lt;P&gt;Did you add the &lt;CODE&gt;WILDCARD&lt;/CODE&gt; setting?  This can only be done in CLI (not the GUI)?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 16:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216693#M63618</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-24T16:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup in subsearch to derive new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216694#M63619</link>
      <description>&lt;P&gt;Apologies for the delay. Awesome solution. Worked like a gem, THANKS&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 16:09:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-in-subsearch-to-derive-new-field/m-p/216694#M63619</guid>
      <dc:creator>sr_dhinesh</dc:creator>
      <dc:date>2016-06-28T16:09:38Z</dc:date>
    </item>
  </channel>
</rss>

