<?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: lookup value based on current search results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407433#M190936</link>
    <description>&lt;P&gt;To rename a field use '&lt;EM&gt;rename&lt;/EM&gt;' command not '&lt;EM&gt;stats&lt;/EM&gt;' which is to categorize data based on a particular field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=identities sourcetype="Vantage" ee_status=* earliest=-1d@d latest=-0d@d 
| eval user = trim(replace(email, "@domain.com", "")) 
| search 
    [| search index="wineventlog" sourcetype="WinEventLog:Security" (EventCode=4624 AND Logon_Type=2) OR EventCode=4625 earliest=-10m latest=now() 
    | table user ] 
| eval fullname = toString(ad_fname) + " " + toString(ad_last_name) 
| table user,department,ad_fname,ad_last_name, Workstation_Name
| rename user as "Login ID", fullname as "Full Name", department as Department, Workstation_Name as Device
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Reference:&lt;/STRONG&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Stats"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Stats&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Rename"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Rename&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2019 05:19:28 GMT</pubDate>
    <dc:creator>jawaharas</dc:creator>
    <dc:date>2019-07-26T05:19:28Z</dc:date>
    <item>
      <title>lookup value based on current search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407432#M190935</link>
      <description>&lt;P&gt;New to Splunk and having a difficult time returning the correct results. The below query works... meaning that it converts the email address to &lt;STRONG&gt;user&lt;/STRONG&gt; from the &lt;STRONG&gt;identities&lt;/STRONG&gt; index and successfully looks up the value of &lt;STRONG&gt;user&lt;/STRONG&gt; in the &lt;STRONG&gt;wineventlog&lt;/STRONG&gt; index that contain either &lt;STRONG&gt;EventCode 4624&lt;/STRONG&gt; or &lt;STRONG&gt;4625&lt;/STRONG&gt; based on the provide critera. However, when the &lt;STRONG&gt;stats&lt;/STRONG&gt; are listed in the table after the query has completed, the &lt;STRONG&gt;values(user) as "Login ID"&lt;/STRONG&gt; does not line up with &lt;STRONG&gt;values(fullname) as "Full Name", values(department) as Department&lt;/STRONG&gt; and the &lt;STRONG&gt;device&lt;/STRONG&gt; name does not show. &lt;STRONG&gt;&lt;EM&gt;Example: Login ID = tJones Full Name = Sammy Smith&lt;/EM&gt;&lt;/STRONG&gt; The goal is to have all the fields line up simular to Tjone | Tom Jones | Department Name | Device. Thanks in advance for any assistance provided. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=identities sourcetype="Vantage" ee_status=* earliest=-1d@d latest=-0d@d
| eval user = trim(replace(email, "@domain.com", ""))
| search  [ | search index="wineventlog"  sourcetype="WinEventLog:Security" (EventCode=4624 AND Logon_Type=2) OR EventCode=4625 earliest=-10m latest=now()| fields user| format]
| table user,department,ad_fname,ad_last_name, Workstation_Name
| eval fullname = toString(ad_fname) + " " + toString(ad_last_name)
| stats values(user) as "Login ID", values(fullname) as "Full Name", values(department) as Department, values(Workstation_Name) as Device
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Jul 2019 22:14:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407432#M190935</guid>
      <dc:creator>lbrhyne</dc:creator>
      <dc:date>2019-07-25T22:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: lookup value based on current search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407433#M190936</link>
      <description>&lt;P&gt;To rename a field use '&lt;EM&gt;rename&lt;/EM&gt;' command not '&lt;EM&gt;stats&lt;/EM&gt;' which is to categorize data based on a particular field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=identities sourcetype="Vantage" ee_status=* earliest=-1d@d latest=-0d@d 
| eval user = trim(replace(email, "@domain.com", "")) 
| search 
    [| search index="wineventlog" sourcetype="WinEventLog:Security" (EventCode=4624 AND Logon_Type=2) OR EventCode=4625 earliest=-10m latest=now() 
    | table user ] 
| eval fullname = toString(ad_fname) + " " + toString(ad_last_name) 
| table user,department,ad_fname,ad_last_name, Workstation_Name
| rename user as "Login ID", fullname as "Full Name", department as Department, Workstation_Name as Device
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Reference:&lt;/STRONG&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Stats"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Stats&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Rename"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Rename&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 05:19:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407433#M190936</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-07-26T05:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: lookup value based on current search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407434#M190937</link>
      <description>&lt;P&gt;Thank you Jawaharas, that worked! The last thing I'm still not able to pull into the report is the Device name from the wineventlog, as it remains to be blank. &lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 13:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407434#M190937</guid>
      <dc:creator>lbrhyne</dc:creator>
      <dc:date>2019-07-26T13:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: lookup value based on current search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407435#M190938</link>
      <description>&lt;P&gt;Kindly accept the answer it it helped you, so others can refer it. &lt;/P&gt;

&lt;P&gt;The field names are case sensitive. Verify the field name 'Workstation_Name'&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2019 03:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407435#M190938</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-07-27T03:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: lookup value based on current search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407436#M190939</link>
      <description>&lt;P&gt;You should click &lt;CODE&gt;Accept&lt;/CODE&gt; to close this question and if you have something different (even if related), ask another.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 13:13:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/lookup-value-based-on-current-search-results/m-p/407436#M190939</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-28T13:13:49Z</dc:date>
    </item>
  </channel>
</rss>

