<?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: Use lookup table values as a input for search query and display lookup table values with query manipulated fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317946#M166232</link>
    <description>&lt;P&gt;On top of my mind, you can run a search for all indexes of the lookup table and display final result like this:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[|inputlookup mylookuptable.csv | table Indexname | rename Indexname as index]
| your search to generate required statistics, make sure to include field 'index'
| table index anyotherfield
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can get better suggestions if you could share your actual query.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Sep 2017 15:53:20 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-09-05T15:53:20Z</dc:date>
    <item>
      <title>Use lookup table values as a input for search query and display lookup table values with query manipulated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317945#M166231</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
I have a lookup table with the field (indexname). I want to use each lookup table field (indexname) values as a input to index in the search query.&lt;BR /&gt;
so each time , query should pick one value from lookup table sequentially and execute search and display results as new column in same lookup table.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;mylookuptable.csv&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3452iE8DB5825EF0B2CB8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;result as :&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3453i590C41B3ACC5BADD/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;please, help me to derive query for this.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Mala S&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 15:23:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317945#M166231</guid>
      <dc:creator>mala_splunk_91</dc:creator>
      <dc:date>2017-09-05T15:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Use lookup table values as a input for search query and display lookup table values with query manipulated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317946#M166232</link>
      <description>&lt;P&gt;On top of my mind, you can run a search for all indexes of the lookup table and display final result like this:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[|inputlookup mylookuptable.csv | table Indexname | rename Indexname as index]
| your search to generate required statistics, make sure to include field 'index'
| table index anyotherfield
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can get better suggestions if you could share your actual query.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 15:53:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317946#M166232</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-05T15:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Use lookup table values as a input for search query and display lookup table values with query manipulated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317947#M166233</link>
      <description>&lt;P&gt;So I have a working example of this&lt;/P&gt;

&lt;P&gt;The PegaVerbose.csv looks like this&lt;/P&gt;

&lt;P&gt;PegaAlertNumber PegaAlertV  PegaLevel&lt;BR /&gt;
PEGA0001    PEGA0001-HTTP interaction time exceeds limit    Medium&lt;BR /&gt;
PEGA0002    PEGA0002-Commit operation time exceeds limit    High&lt;BR /&gt;
PEGA0003    PEGA0003-Rollback operation time exceeds limit  Medium&lt;BR /&gt;
PEGA0004    PEGA0004-Quantity of data received by database query exceeds limit  High&lt;BR /&gt;
PEGA0005    PEGA0005-Query time exceeds limit   Medium&lt;/P&gt;

&lt;P&gt;And the search I use is&lt;/P&gt;

&lt;P&gt;index=application sourcetype=Pega:Prod  (PegaAlert=*)  |lookup PegaVerbose.csv PegaAlertNumber as PegaAlert OUTPUT PegaAlertNumber PegaAlertV PegaLevel &lt;/P&gt;

&lt;P&gt;It matches up an event in the actual indexed data (the field named PegaAlert) with PegaAlertNumber in the csv, and then adds two new fields PegaAlertV PegaLevel that are available then for whatever you want. &lt;/P&gt;

&lt;P&gt;We also use this app for editing lookup files.&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/1724/"&gt;https://splunkbase.splunk.com/app/1724/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Good luck.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3451i91A41AEBDFAD5A1D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 18:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317947#M166233</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2017-09-05T18:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Use lookup table values as a input for search query and display lookup table values with query manipulated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317948#M166234</link>
      <description>&lt;P&gt;It is generally not a good idea in Splunk to think in terms of "sequentially" doing anything.  Usually you can code a search so that all the searching happens at the same time, or in exactly two phases, rather than one search per input record.  &lt;/P&gt;

&lt;P&gt;Let's suppose that you have a file which has the index name and a value for another field, fieldA.  In that situation, doing this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv myindexandfieldA.csv | table Indexname fieldA | rename Indexname as index | format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... creates a single field called "search" that contains this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(  ( index="index1" AND fieldA="value1" ) OR  ( index="index2" AND fieldA="value2" ) OR .... )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you include that all within square braces at the beginning of your search, then it will bring back all the relevant records for processing.  (note - the word "format" is optional if the rest of the code is inside of square braces.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   [| inputcsv myindexandfieldA.csv | table Indexname fieldA | rename Indexname as index | format]
    | stats sum(someotherfield) as manipulatedresult by index fieldA
    | table index fieldA manipulatedresult
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Sep 2017 18:28:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317948#M166234</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-05T18:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Use lookup table values as a input for search query and display lookup table values with query manipulated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317949#M166235</link>
      <description>&lt;P&gt;Here is my query, I need to check TrafficStatus for each Application. When i execute this query am not getting expected result.&lt;/P&gt;

&lt;P&gt;[|inputlookup mylookuptable.csv | table Application| rename Application as index1] |search index=$index1$ host=XXXX* | stats count as RR| eval TrafficStatus=if(RR&amp;gt;1000,"X1","X2")|table index1 TrafficStatus&lt;/P&gt;

&lt;P&gt;Help on this!!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 08:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317949#M166235</guid>
      <dc:creator>mala_splunk_91</dc:creator>
      <dc:date>2017-09-06T08:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Use lookup table values as a input for search query and display lookup table values with query manipulated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317950#M166236</link>
      <description>&lt;P&gt;Thanks for suggestion. &lt;BR /&gt;
Here is my query. But I'm not able to get result.&lt;/P&gt;

&lt;P&gt;[|inputlookup mylookuptable.csv | table Application Normal_Traffic_status| rename Application as index format]|search host=xxx* |stats count as RR by index|eval TrafficStatus=if(RR&amp;gt;1000,"Reston","Chicago")|table index TrafficStatus Normal_Traffic_status&lt;/P&gt;

&lt;P&gt;pls, check if anything worn in this.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Mala &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:37:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317950#M166236</guid>
      <dc:creator>mala_splunk_91</dc:creator>
      <dc:date>2020-09-29T15:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Use lookup table values as a input for search query and display lookup table values with query manipulated fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317951#M166237</link>
      <description>&lt;P&gt;In addition to above query,&lt;BR /&gt;
I want "Application" fields values to be added in search, but not "Normal_Traffic_status" field values. &lt;BR /&gt;
As a result , I should get "Application", Normal_Traffic_status" ,"TrafficStatus "  fields in a table.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:37:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-lookup-table-values-as-a-input-for-search-query-and-display/m-p/317951#M166237</guid>
      <dc:creator>mala_splunk_91</dc:creator>
      <dc:date>2020-09-29T15:37:24Z</dc:date>
    </item>
  </channel>
</rss>

