<?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: How to create a table which matches a lookup file and fields created at search time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/521126#M146818</link>
    <description>&lt;P&gt;I'm new to Splunk and was wondering about the same thing. on the context below, is that the beginning of the search string? usually it starts with index=.....&amp;nbsp; &amp;nbsp; So what i'm trying to get is a lookup of&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=_internal* log_level=WARN OR log_level=ERR host=XPxx9* OR host=GPxx7* OR host=fsr*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but instead of listing like 30 of the host names with OR arguments, what's the ideal way to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&lt;STRONG&gt;| tstats&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; count WHERE index=* by index host| table index host | lookup inventory.csv "Server Name" as host OUTPUT "Application Name" | where isnotnull('Application Name') | rename index as Index host as "Server Name"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2020 18:50:15 GMT</pubDate>
    <dc:creator>ngox0061</dc:creator>
    <dc:date>2020-09-23T18:50:15Z</dc:date>
    <item>
      <title>How to create a table which matches a lookup file and fields created at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207232#M60436</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;

&lt;P&gt;I am trying to create a search which will give me an output similar to below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Index   Server Name Application Name
Web   Server 1          ABC
app      Server 3           HUG
DB       Server 4           SMILE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the above table:  Server Name, Application Name are from a lookup file named inventory.csv&lt;BR /&gt;
We have also created a lookup named inventorys&lt;/P&gt;

&lt;P&gt;Only values matching host and Server Name must be displayed in the table,&lt;BR /&gt;
I am looking for unique listing only &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;host&lt;/STRONG&gt; and &lt;STRONG&gt;index&lt;/STRONG&gt; are fields created during search time&lt;/P&gt;

&lt;P&gt;I tried many commands but i am not able to find a search that will correlate the "Server Name"in the lookup files with host in the event&lt;/P&gt;

&lt;P&gt;I think it should be a simple search but since I am new to Splunk, i am not able to find the answer&lt;/P&gt;

&lt;P&gt;Thank you for helping&lt;/P&gt;

&lt;P&gt;Regards&lt;BR /&gt;
aparna&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:26:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207232#M60436</guid>
      <dc:creator>aparnaa</dc:creator>
      <dc:date>2016-11-02T16:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table which matches a lookup file and fields created at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207233#M60437</link>
      <description>&lt;P&gt;Assuming the &lt;CODE&gt;index&lt;/CODE&gt; and &lt;CODE&gt;host&lt;/CODE&gt; fields come from your base search, and &lt;CODE&gt;Server Name&lt;/CODE&gt; and &lt;CODE&gt;Application Name&lt;/CODE&gt; are from your lookup file, where &lt;CODE&gt;host&lt;/CODE&gt; and &lt;CODE&gt;Server Name&lt;/CODE&gt; should correlate, your search will look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;base search&amp;gt; |  lookup inventory.csv "Server Name" as host OUTPUT "Application Name" | table index host "Application Name" | rename host as "Server Name"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 17:00:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207233#M60437</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2016-11-02T17:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table which matches a lookup file and fields created at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207234#M60438</link>
      <description>&lt;P&gt;Try like this (assuming host and index are Splunk's default metadata fields)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count WHERE index=* by index host| table index host | lookup inventory.csv "Server Name" as host OUTPUT "Application Name" | where isnotnull('Application Name') | rename index as Index host as "Server Name"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count WHERE index=* [| inputlookup inventory.csv | table "Server Name" | rename "Server Name" as host] by index host | table index host | lookup inventory.csv "Server Name" as host OUTPUT "Application Name" | where isnotnull('Application Name') | rename index as Index host as "Server Name"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 17:01:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207234#M60438</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-02T17:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table which matches a lookup file and fields created at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207235#M60439</link>
      <description>&lt;P&gt;thank you so much !&lt;BR /&gt;
It worked exactly the way i wanted &lt;BR /&gt;
I added dedup command to remove duplicate values &lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 07:08:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207235#M60439</guid>
      <dc:creator>aparnaa</dc:creator>
      <dc:date>2016-11-03T07:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table which matches a lookup file and fields created at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207236#M60440</link>
      <description>&lt;P&gt;I've been attempting to implement this functionality for days. This finally helped me get it working. Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 16:35:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/207236#M60440</guid>
      <dc:creator>danataylor</dc:creator>
      <dc:date>2017-08-28T16:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table which matches a lookup file and fields created at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/521126#M146818</link>
      <description>&lt;P&gt;I'm new to Splunk and was wondering about the same thing. on the context below, is that the beginning of the search string? usually it starts with index=.....&amp;nbsp; &amp;nbsp; So what i'm trying to get is a lookup of&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=_internal* log_level=WARN OR log_level=ERR host=XPxx9* OR host=GPxx7* OR host=fsr*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but instead of listing like 30 of the host names with OR arguments, what's the ideal way to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&lt;STRONG&gt;| tstats&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; count WHERE index=* by index host| table index host | lookup inventory.csv "Server Name" as host OUTPUT "Application Name" | where isnotnull('Application Name') | rename index as Index host as "Server Name"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 18:50:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-which-matches-a-lookup-file-and-fields/m-p/521126#M146818</guid>
      <dc:creator>ngox0061</dc:creator>
      <dc:date>2020-09-23T18:50:15Z</dc:date>
    </item>
  </channel>
</rss>

