<?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 Internal lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Internal-lookup/m-p/82329#M20912</link>
    <description>&lt;P&gt;I need to do a lookup on search result with data from splunk internal. I have a log which logs when a user login and what PID that user get assigned to such as:&lt;/P&gt;

&lt;P&gt;PID: 2938  [DATE]&lt;/P&gt;

&lt;P&gt;22: Command [username]&lt;/P&gt;

&lt;P&gt;In the same log the actions the user takes during the session is logged with the following format:&lt;/P&gt;

&lt;P&gt;PID: 2938 [DATE]&lt;BR /&gt;
22: Command [custom data]&lt;/P&gt;

&lt;P&gt;Now i would like to generate an report using this data and translate the PID to a username using lookup. The result would be a table with Username, PID and Command.&lt;/P&gt;

&lt;P&gt;When i search for lookup information i can find that i can do lookups from scripts or CSV files, not from Splunk queries, is it possible to do such query?&lt;/P&gt;</description>
    <pubDate>Fri, 15 Apr 2011 09:41:10 GMT</pubDate>
    <dc:creator>mrdaniel</dc:creator>
    <dc:date>2011-04-15T09:41:10Z</dc:date>
    <item>
      <title>Internal lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Internal-lookup/m-p/82329#M20912</link>
      <description>&lt;P&gt;I need to do a lookup on search result with data from splunk internal. I have a log which logs when a user login and what PID that user get assigned to such as:&lt;/P&gt;

&lt;P&gt;PID: 2938  [DATE]&lt;/P&gt;

&lt;P&gt;22: Command [username]&lt;/P&gt;

&lt;P&gt;In the same log the actions the user takes during the session is logged with the following format:&lt;/P&gt;

&lt;P&gt;PID: 2938 [DATE]&lt;BR /&gt;
22: Command [custom data]&lt;/P&gt;

&lt;P&gt;Now i would like to generate an report using this data and translate the PID to a username using lookup. The result would be a table with Username, PID and Command.&lt;/P&gt;

&lt;P&gt;When i search for lookup information i can find that i can do lookups from scripts or CSV files, not from Splunk queries, is it possible to do such query?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 09:41:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Internal-lookup/m-p/82329#M20912</guid>
      <dc:creator>mrdaniel</dc:creator>
      <dc:date>2011-04-15T09:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Internal lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Internal-lookup/m-p/82330#M20913</link>
      <description>&lt;P&gt;You could either use the &lt;A href="http://www.splunk.com/base/DOcumentation/latest/SearchReference/Join"&gt;join&lt;/A&gt; or &lt;A href="http://www.splunk.com/base/DOcumentation/latest/SearchReference/Transaction"&gt;transaction&lt;/A&gt; command to combine the metadata of 2 searches.&lt;/P&gt;

&lt;P&gt;Or use stats to aggregate the information on a unqiue key:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search maching both events&amp;gt; | stats first(Command) as Command first(Username) as Username by PID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Another, more complicated option is to write a scripted lookup or a command which can execute searches in Splunk. But I don't think this is necessary. &lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 11:58:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Internal-lookup/m-p/82330#M20913</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2011-04-15T11:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Internal lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Internal-lookup/m-p/82331#M20914</link>
      <description>&lt;P&gt;Thanks i had to modify this a bit as there are more than one Command, so I use&lt;/P&gt;

&lt;P&gt;&lt;SEARCH maching="" both="" events=""&gt; | stats list(Command) as Command first(Username) as Username by PID&lt;/SEARCH&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2011 12:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Internal-lookup/m-p/82331#M20914</guid>
      <dc:creator>mrdaniel</dc:creator>
      <dc:date>2011-04-19T12:22:18Z</dc:date>
    </item>
  </channel>
</rss>

