<?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: How do I compare lookup field to search and print another field in lookup file? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/638693#M221307</link>
    <description>&lt;P&gt;You would need to use "lookup" command to enrich your data from lookup table fields, like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=windows sourcetype:eventlogs 
| lookup users.csv hostname as host OUTPUT username as users&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 04 Apr 2023 18:39:51 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2023-04-04T18:39:51Z</dc:date>
    <item>
      <title>How do I compare lookup field to search and print another field in lookup file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/638681#M221304</link>
      <description>&lt;P&gt;Currently in my logs I am getting the hostname of the users but not their usernames. I created a lookup table that contains hostnames and usernames. I am trying to match the hostname from search to the hostname in the lookup file and then print their correlated username in a table format in the search visualization.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Lookup file:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;hostname&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;username&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;host1&lt;/TD&gt;&lt;TD width="50%"&gt;user1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;host2&lt;/TD&gt;&lt;TD width="50%"&gt;user2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;host3&lt;/TD&gt;&lt;TD width="50%"&gt;user3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;host4&lt;/TD&gt;&lt;TD width="50%"&gt;user4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;search:&lt;BR /&gt;index=windows sourcetype:eventlogs&amp;nbsp;&lt;BR /&gt;[|inputlookup users.csv | fields hostname username | rename hostname as users]&lt;BR /&gt;~~~print username correlated to "users" in the above string.~~~&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 16:33:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/638681#M221304</guid>
      <dc:creator>cyrus_thesplunk</dc:creator>
      <dc:date>2023-04-04T16:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare lookup field to search and print another field in lookup file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/638693#M221307</link>
      <description>&lt;P&gt;You would need to use "lookup" command to enrich your data from lookup table fields, like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=windows sourcetype:eventlogs 
| lookup users.csv hostname as host OUTPUT username as users&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 04 Apr 2023 18:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/638693#M221307</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2023-04-04T18:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare lookup field to search and print another field in lookup file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/638818#M221345</link>
      <description>&lt;P&gt;Got it. I understand this part but where are you comparing the hostname in the search to hostname in the lookup file and then printing the username correlated to that hostname in the table.&lt;BR /&gt;&lt;BR /&gt;This is what the search visualization results should look like.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;Time&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Hostname&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Username&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Src IP&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;5:01 am&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;host1&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;user1&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;192.xxx.xxx.xxx&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;5:07 am&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;host2&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;user2&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;192.xxx.xxx.xxx&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;5:09 am&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;host3&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;user3&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;192.xxx.xxx.xxx&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Username information is the only thing thats coming from the lookup file. Rest of it comes from the search.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 11:03:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/638818#M221345</guid>
      <dc:creator>cyrus_thesplunk</dc:creator>
      <dc:date>2023-04-05T11:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare lookup field to search and print another field in lookup file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/638925#M221392</link>
      <description>&lt;P&gt;index="windows" AND sourcetype="eventlogs"&lt;BR /&gt;| lookup users.csv hostname AS host OUTPUT username AS users&lt;BR /&gt;| table _time Time Hostname Username Src IP&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 00:24:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/638925#M221392</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2023-04-06T00:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare lookup field to search and print another field in lookup file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/639022#M221421</link>
      <description>&lt;P&gt;Thank you! This worked perfectly&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 13:17:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-lookup-field-to-search-and-print-another-field/m-p/639022#M221421</guid>
      <dc:creator>cyrus_thesplunk</dc:creator>
      <dc:date>2023-04-06T13:17:33Z</dc:date>
    </item>
  </channel>
</rss>

