<?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: In a tstats query, how to discover the username's line manager which is listed in the lookup? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386427#M112767</link>
    <description>&lt;P&gt;So I  can run a lookup and then use the results of that lookup in another lookup so for example:&lt;/P&gt;

&lt;P&gt;| tstats summariesonly=t count FROM Datamodel=x WHER earliest=@d latest=now x.EventName="Login" BY X.EventName, X.Username&lt;BR /&gt;
 | lookup lookupname.csv username AS X.Username OUTPUT managerID |  lookup lookupname EmpID as ManagerID OUTPUT email&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jun 2018 12:26:53 GMT</pubDate>
    <dc:creator>griggsy</dc:creator>
    <dc:date>2018-06-18T12:26:53Z</dc:date>
    <item>
      <title>In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386421#M112761</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a tstats query running which returns the data. I then want to look up the username returned as part of that search in a lookup to discover the username's line manager which is listed in the lookup. I just simply can't get it working.&lt;/P&gt;

&lt;P&gt;Can anyone suggest anything? &lt;/P&gt;

&lt;P&gt;Ta.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 11:09:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386421#M112761</guid>
      <dc:creator>griggsy</dc:creator>
      <dc:date>2018-06-18T11:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386422#M112762</link>
      <description>&lt;P&gt;Can you share the query you have so far (that isn't working) and explain what exactly isn't working? Perhaps some info on the data you're querying might help as well.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 11:27:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386422#M112762</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-18T11:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386423#M112763</link>
      <description>&lt;P&gt;Hi Frank,&lt;/P&gt;

&lt;P&gt;So with redacted information:&lt;/P&gt;

&lt;P&gt;| tstats summariesonly=t count FROM Datamodel=x WHER earliest=@d latest=now x.EventName="Login" BY  X.EventName, X.Username&lt;/P&gt;

&lt;P&gt;I  have shortened the above there is more fields however I would like to pass the Username in to a lookup to find a result in a lookup.  so for example | from inputlookup:"LookupName.csv" | search EmailID = $x.username"&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 11:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386423#M112763</guid>
      <dc:creator>griggsy</dc:creator>
      <dc:date>2018-06-18T11:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386424#M112764</link>
      <description>&lt;P&gt;Sounds like a job for the &lt;CODE&gt;lookup&lt;/CODE&gt; command (assuming the lookup contains fields username and manager, adjust according to your situation):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=t count FROM Datamodel=x WHER earliest=@d latest=now x.EventName="Login" BY X.EventName, X.Username
| lookup lookupname.csv username AS X.Username OUTPUT manager
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Jun 2018 11:50:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386424#M112764</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-18T11:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386425#M112765</link>
      <description>&lt;P&gt;Thanks Frank.&lt;/P&gt;

&lt;P&gt;Question once I have returned the Line Manager it returns a userID I then need to look them up against the same lookup to there email. Would I then subsearch that:?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 11:55:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386425#M112765</guid>
      <dc:creator>griggsy</dc:creator>
      <dc:date>2018-06-18T11:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386426#M112766</link>
      <description>&lt;P&gt;Just add another lookup command:  &lt;CODE&gt;| lookup lookupname.csv username AS manager OUTPUT email&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 11:58:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386426#M112766</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-18T11:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386427#M112767</link>
      <description>&lt;P&gt;So I  can run a lookup and then use the results of that lookup in another lookup so for example:&lt;/P&gt;

&lt;P&gt;| tstats summariesonly=t count FROM Datamodel=x WHER earliest=@d latest=now x.EventName="Login" BY X.EventName, X.Username&lt;BR /&gt;
 | lookup lookupname.csv username AS X.Username OUTPUT managerID |  lookup lookupname EmpID as ManagerID OUTPUT email&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 12:26:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386427#M112767</guid>
      <dc:creator>griggsy</dc:creator>
      <dc:date>2018-06-18T12:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386428#M112768</link>
      <description>&lt;P&gt;Exactly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The tstats command just returns a table of data. The first lookup command adds the managerID column to that table based on matching usernames. Then you again have a table of data, so you just apply another lookup command to fetch the manager's email address based on matching emplID.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 12:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386428#M112768</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-18T12:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386429#M112769</link>
      <description>&lt;P&gt;Thanks. I know what I want just find it hard to get there sometimes!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 12:45:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386429#M112769</guid>
      <dc:creator>griggsy</dc:creator>
      <dc:date>2018-06-18T12:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386430#M112770</link>
      <description>&lt;P&gt;You're welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; if it works, please mark the answer as accepted, so others can also easily find the right solution for this question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 12:51:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386430#M112770</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-18T12:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386431#M112771</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Thanks for all your help. The user ID  in the lookup contains the username as email address with  different suffixes. I have  added a * to the end of the possible username in the initial query eg. joebloggs* however the  lookup isn't returning anything.&lt;/P&gt;

&lt;P&gt;if I manually search | from inputlookup: lookupname.csv | search username="joebloggs*" it returns records. Am I  missing something?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 11:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386431#M112771</guid>
      <dc:creator>griggsy</dc:creator>
      <dc:date>2018-06-19T11:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: In a tstats query, how to discover the username's line manager which is listed in the lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386432#M112772</link>
      <description>&lt;P&gt;Think you need to modify your lookup table content to add a username column without the @...  part from the email address then? If your event data contained the email address and the lookup contained the short username without suffix, you could make the lookup do wildcard matching, but the other way around doesn't work as far as I know.&lt;/P&gt;

&lt;P&gt;If you need further help with that, you might want to post a new question on that, not to go too much off-topic here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 12:33:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-tstats-query-how-to-discover-the-username-s-line-manager/m-p/386432#M112772</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-19T12:33:12Z</dc:date>
    </item>
  </channel>
</rss>

