<?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: Return value from separate fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27321#M5306</link>
    <description>&lt;P&gt;Imagine there is a table with two rows:&lt;/P&gt;

&lt;P&gt;Headers&lt;/P&gt;

&lt;P&gt;displayName, sAMAccountName, ManagerRACF, Token_Nr&lt;/P&gt;

&lt;P&gt;Row 1&lt;BR /&gt;
John Doe, JDoe001, JDoe002, 000000001&lt;/P&gt;

&lt;P&gt;Row 2&lt;BR /&gt;
Jane Doe, JDoe002, JDoe003, 000000002&lt;/P&gt;

&lt;P&gt;Splunk should return the results as follows:&lt;/P&gt;

&lt;P&gt;displayName, ManagerRACF, ManagerName, Token_Nr&lt;BR /&gt;
John Doe, JDoe002, Jane Doe, 000000001&lt;/P&gt;

&lt;P&gt;The displayName value from row 2 populates "ManagerName" value field in splunk, based on the data in the "ManagerRACF" value field from row 1.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;Ken&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2013 11:12:58 GMT</pubDate>
    <dc:creator>kengilmour</dc:creator>
    <dc:date>2013-08-07T11:12:58Z</dc:date>
    <item>
      <title>Return value from separate fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27319#M5304</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm looking for a solution to get data from two CSV files that will be used for a one-off search.&lt;/P&gt;

&lt;P&gt;I have the following data:&lt;/P&gt;

&lt;P&gt;CSV 1&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;displayName=Full User's Name (e.g. "John Doe")&lt;/LI&gt;
&lt;LI&gt;ManagerRACF= The Manager's User ID (e.g. Jdoe002)&lt;/LI&gt;
&lt;LI&gt;sAMAccountName=User's User ID (e.g. Jdoe001)&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;CSV 2&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;First_Name&lt;/LI&gt;
&lt;LI&gt;Last_Name&lt;/LI&gt;
&lt;LI&gt;Token_Nr&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;What I want to do is get combine CSV2 with CSV1 (easy) and then find the person's manager's full name with nothing more than the ManagerRACF field (unknown).&lt;/P&gt;

&lt;P&gt;For the first part:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=CSV1.csv
|join displayName[search index="main" source="CSV2.csv" | eval displayName=First_Name." ".Last_Name |dedup displayName| fields + displayName]
| table displayName, ManagerRACF, ManagerName, Token_Nr
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will join the two files and show the user's full name, the Manager's UserID and the user's Token number.&lt;/P&gt;

&lt;P&gt;Now how do i get ManagerName to translate into the full name of the person's manager from CSV 1 based on the data in the ManagerRACF column? Basically what this means is, I need to find data in ManagerRACF (Jdoe002) search the sAMAccountName column for that value, and then return the results from displayName on that row into the ManagerName column.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;Ken&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 09:59:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27319#M5304</guid>
      <dc:creator>kengilmour</dc:creator>
      <dc:date>2013-08-07T09:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Return value from separate fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27320#M5305</link>
      <description>&lt;P&gt;can you explain more ...&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 10:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27320#M5305</guid>
      <dc:creator>kml_uvce</dc:creator>
      <dc:date>2013-08-07T10:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Return value from separate fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27321#M5306</link>
      <description>&lt;P&gt;Imagine there is a table with two rows:&lt;/P&gt;

&lt;P&gt;Headers&lt;/P&gt;

&lt;P&gt;displayName, sAMAccountName, ManagerRACF, Token_Nr&lt;/P&gt;

&lt;P&gt;Row 1&lt;BR /&gt;
John Doe, JDoe001, JDoe002, 000000001&lt;/P&gt;

&lt;P&gt;Row 2&lt;BR /&gt;
Jane Doe, JDoe002, JDoe003, 000000002&lt;/P&gt;

&lt;P&gt;Splunk should return the results as follows:&lt;/P&gt;

&lt;P&gt;displayName, ManagerRACF, ManagerName, Token_Nr&lt;BR /&gt;
John Doe, JDoe002, Jane Doe, 000000001&lt;/P&gt;

&lt;P&gt;The displayName value from row 2 populates "ManagerName" value field in splunk, based on the data in the "ManagerRACF" value field from row 1.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;Ken&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 11:12:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27321#M5306</guid>
      <dc:creator>kengilmour</dc:creator>
      <dc:date>2013-08-07T11:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Return value from separate fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27322#M5307</link>
      <description>&lt;P&gt;I see that you indexed this data into Splunk, but honestly this doesn't seem like the best way to approach the problem. I think that CSV 1 (can we call it "AccountInfo") should be a lookup table, not indexed into Splunk. &lt;/P&gt;

&lt;P&gt;If you load the CSV file into Splunk and create a lookup called &lt;CODE&gt;AccountLookup&lt;/CODE&gt; (&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.4/Tutorial/Usefieldlookups"&gt;lookup tutorial here&lt;/A&gt; and &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.4/Knowledge/Addfieldsfromexternaldatasources"&gt;manual here&lt;/A&gt;), then you can do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=csv2
| eval displayName = First_Name + " " + Last_Name
| lookup AccountLookup displayName OUTPUT ManagerRACF as inRACF
| lookup AccountLookup sAMAccountName as inRACF OUTPUT displayName as ManagerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should do it!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 21:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27322#M5307</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-08-07T21:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Return value from separate fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27323#M5308</link>
      <description>&lt;P&gt;Yep, along my line of thinking as well. Actually both of the CSV's are pretty good candidates for lookup tables, and in my opinion CSV2 is preferable, as you tend to change managers more often than you change your name  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  &lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2013 10:34:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27323#M5308</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-08-08T10:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Return value from separate fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27324#M5309</link>
      <description>&lt;P&gt;I agree, but I thought maybe the token assigned to the name changed regularly, and I certainily didn't want to get into time-based lookups as a starting point!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2013 18:11:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27324#M5309</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-08-08T18:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Return value from separate fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27325#M5310</link>
      <description>&lt;P&gt;Aah, you might be right, I actually read "token" as "userID"&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2013 08:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27325#M5310</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-08-09T08:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Return value from separate fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27326#M5311</link>
      <description>&lt;P&gt;I guess all data is "static" - it's just a matter of the time frame! And illustrates the importance of actually understanding the data before making these decisions...&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2013 17:21:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-value-from-separate-fields/m-p/27326#M5311</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-08-09T17:21:10Z</dc:date>
    </item>
  </channel>
</rss>

