<?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: Better search query way in terms of performance in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467387#M191883</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search
| lookup yourSourcetype1lookup.csv fieldName OUTPUT ghi as ghi1
| lookup yourSourcetype2lookup.csv fieldName OUTPUT ghi as ghi2
| eval ghi=iff(sourcetype="sourcetype1", ghi1,ghi2) | fields - ghi1 ghi2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 03 Sep 2019 14:00:09 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2019-09-03T14:00:09Z</dc:date>
    <item>
      <title>Better search query way in terms of performance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467385#M191881</link>
      <description>&lt;P&gt;I have below search criteria so let me know best way for this.&lt;/P&gt;

&lt;P&gt;base search (which have output in table format) [table sourcetype def ghi]&lt;BR /&gt;
sourcetype= 1 check with static lookup and store respective result in "ghi" field&lt;BR /&gt;
sourcetype= 2 check with static lookup and store respective result in "ghi" field&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 13:38:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467385#M191881</guid>
      <dc:creator>N92</dc:creator>
      <dc:date>2019-09-03T13:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Better search query way in terms of performance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467386#M191882</link>
      <description>&lt;P&gt;Can you please provide samples of what your table represents, and what you want to do with the two sourcetype lines you mention?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 13:47:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467386#M191882</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2019-09-03T13:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Better search query way in terms of performance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467387#M191883</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search
| lookup yourSourcetype1lookup.csv fieldName OUTPUT ghi as ghi1
| lookup yourSourcetype2lookup.csv fieldName OUTPUT ghi as ghi2
| eval ghi=iff(sourcetype="sourcetype1", ghi1,ghi2) | fields - ghi1 ghi2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Sep 2019 14:00:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467387#M191883</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-09-03T14:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Better search query way in terms of performance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467388#M191884</link>
      <description>&lt;P&gt;| table dest user source sourcetype result&lt;BR /&gt;
| lookup users.csv users as user OUTPUT host_name as result&lt;BR /&gt;
| lookup users.csv source as user OUTPUT host_name as result&lt;/P&gt;

&lt;P&gt;For both the lookup condition I am try to distinguish with sourcetype condition.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:58:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467388#M191884</guid>
      <dc:creator>N92</dc:creator>
      <dc:date>2020-09-30T01:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Better search query way in terms of performance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467389#M191885</link>
      <description>&lt;P&gt;It works. Thanks @somesoni2 &lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 15:42:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467389#M191885</guid>
      <dc:creator>N92</dc:creator>
      <dc:date>2019-09-03T15:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Better search query way in terms of performance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467390#M191886</link>
      <description>&lt;P&gt;Create a simple lookup file, e.g. sourcetype_ghi_lookup.csv, with two fields, sourcetype and ghi. E.g. For sourcetype=1 and sourcetype=2:&lt;/P&gt;

&lt;P&gt;sourcetype,ghi&lt;BR /&gt;
1,"some ghi value"&lt;BR /&gt;
2,"another ghi value"&lt;/P&gt;

&lt;P&gt;| lookup sourcetype_ghi_lookup.csv sourcetype output ghi&lt;/P&gt;

&lt;P&gt;You can use the file in both a lookup and automatic lookup definition to omit the lookup command in searches and populate the ghi field automatically.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:58:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Better-search-query-way-in-terms-of-performance/m-p/467390#M191886</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2020-09-30T01:58:52Z</dc:date>
    </item>
  </channel>
</rss>

