<?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: What does format do after a table lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-does-format-do-after-a-table-lookup/m-p/316318#M94674</link>
    <description>&lt;P&gt;Thanks.  It makes a lot more sense now.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Apr 2018 19:10:49 GMT</pubDate>
    <dc:creator>OldManEd</dc:creator>
    <dc:date>2018-04-06T19:10:49Z</dc:date>
    <item>
      <title>What does format do after a table lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-does-format-do-after-a-table-lookup/m-p/316315#M94671</link>
      <description>&lt;P&gt;I inherited a search that contains he following line;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[| inputlookup &amp;lt;lookup table name&amp;gt; | format ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I can't figure out what it does.  The table contains one column with a title of my_field.  The data is numbers and subnet addresses, (Like 1.2.3.4/24).  Now there is a field from the raw event called my_field, but I can't figure out how everything works together.&lt;/P&gt;

&lt;P&gt;After the line there is the ~stats~ portion of the search that summarizes the data and my_field is mentioned like below;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats sum(field_b) by my_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but I'm not sure what the lookup does for me.  I guess I'm trying to understand what the inputlookup format above does.  I can't really find anything in the docs.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:53:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-does-format-do-after-a-table-lookup/m-p/316315#M94671</guid>
      <dc:creator>OldManEd</dc:creator>
      <dc:date>2020-09-29T18:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: What does format do after a table lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-does-format-do-after-a-table-lookup/m-p/316316#M94672</link>
      <description>&lt;P&gt;FORMAT- This command is used implicitly by subsearches. This command takes the results of a subsearch, formats the results into a single result and places that result into a new field called search.&lt;BR /&gt;
Refer this doc for more info.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Format"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Format&lt;/A&gt;&lt;BR /&gt;
You can run &lt;CODE&gt;| inputlookup &amp;lt;lookup table name&amp;gt; | format&lt;/CODE&gt; seperately to see what you get in search field and then you may try to understand query.&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 17:16:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-does-format-do-after-a-table-lookup/m-p/316316#M94672</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-06T17:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: What does format do after a table lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-does-format-do-after-a-table-lookup/m-p/316317#M94673</link>
      <description>&lt;P&gt;Based on your description of the search, I suspect the search is structured to use the data in the lookup file as a search filter, which will narrow the results of the base search to only events containing &lt;CODE&gt;my_field&lt;/CODE&gt; values that are present in the lookup file. &lt;/P&gt;

&lt;P&gt;As @mayurr98 pointed out, the &lt;CODE&gt;format&lt;/CODE&gt; command itself isn't really doing much in the context of this search, because it's used implicitly in subsearches anyway. &lt;/P&gt;

&lt;P&gt;If I'm correct about the intention of the user who wrote the search, it's probably structured like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=something sourcetype=whatever 
[| inputlookup &amp;lt;lookup table&amp;gt; 
 | format ] 
| stats sum(field_b) by my_field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Apr 2018 17:22:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-does-format-do-after-a-table-lookup/m-p/316317#M94673</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-06T17:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: What does format do after a table lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-does-format-do-after-a-table-lookup/m-p/316318#M94674</link>
      <description>&lt;P&gt;Thanks.  It makes a lot more sense now.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 19:10:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-does-format-do-after-a-table-lookup/m-p/316318#M94674</guid>
      <dc:creator>OldManEd</dc:creator>
      <dc:date>2018-04-06T19:10:49Z</dc:date>
    </item>
  </channel>
</rss>

