<?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: Looking to add a field from another searched index to a finished table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681246#M232797</link>
    <description>&lt;P&gt;When trying this, the result was the same as the previous attempt, only the hosts and username fields populating&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2024 20:02:05 GMT</pubDate>
    <dc:creator>psomeshwar</dc:creator>
    <dc:date>2024-03-19T20:02:05Z</dc:date>
    <item>
      <title>Looking to add a field from another searched index to a finished table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681231#M232791</link>
      <description>&lt;P&gt;Currently, I have two tables&lt;/P&gt;&lt;P&gt;Table1&lt;/P&gt;&lt;P&gt;hostnames&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vendors&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; products&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; versions&lt;BR /&gt;host1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vendor1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version1&lt;BR /&gt;host2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vendor2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version2&lt;BR /&gt;host3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vendor3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version3&lt;BR /&gt;host4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vendor4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version4&lt;/P&gt;&lt;P&gt;Table2&lt;/P&gt;&lt;P&gt;device.hostname&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; device.username&lt;BR /&gt;HOST1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; user1&lt;BR /&gt;HOST2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; user2&lt;BR /&gt;HOST3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; user3&lt;BR /&gt;HOST4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; user4&lt;/P&gt;&lt;P&gt;The table that I want to generate from these two is the following:&lt;/P&gt;&lt;P&gt;Table3&lt;/P&gt;&lt;P&gt;hosts&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; username&amp;nbsp; &amp;nbsp; &amp;nbsp; vendors&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; products&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; versions&lt;BR /&gt;host1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;vendor1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version1&lt;BR /&gt;host2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;vendor2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version4&lt;BR /&gt;host3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;vendor3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version3&lt;BR /&gt;host4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;vendor4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The search I tried was the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2)
| rename device.hostname as hostname
| rename device.username as username
| eval hosts = coalesce(hostnames, hostname)
| table hosts, username, vendors, products, versions&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result was the following:&lt;/P&gt;&lt;P&gt;hosts&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; username&amp;nbsp; &amp;nbsp; &amp;nbsp; vendors&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; products&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; versions&lt;BR /&gt;host1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vendor1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version1&lt;BR /&gt;host2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vendor2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version4&lt;BR /&gt;host3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vendor3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version3&lt;BR /&gt;host4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vendor4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; product4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version4&lt;BR /&gt;HOST1&amp;nbsp; &amp;nbsp; &amp;nbsp; user1&lt;BR /&gt;HOST2&amp;nbsp; &amp;nbsp; &amp;nbsp; user2&lt;BR /&gt;HOST3&amp;nbsp; &amp;nbsp; &amp;nbsp; user3&lt;BR /&gt;HOST4&amp;nbsp; &amp;nbsp; &amp;nbsp; user4&lt;/P&gt;&lt;P&gt;host1 and HOST1 both reference the same hostname, just one index had the letters capitalized and the other did not.&lt;/P&gt;&lt;P&gt;Does anyone have any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 19:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681231#M232791</guid>
      <dc:creator>psomeshwar</dc:creator>
      <dc:date>2024-03-19T19:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to add a field from another searched index to a finished table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681236#M232793</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2)
| rename device.hostname as hostname
| rename device.username as username
| eval hosts = lower(hosts)
| stats values(*) as * by hosts
| table hosts, username, vendors, products, versions&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 19:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681236#M232793</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-03-19T19:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to add a field from another searched index to a finished table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681237#M232794</link>
      <description>&lt;P&gt;So, I tried your solution and the result was:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;hosts&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; username&amp;nbsp; &amp;nbsp; &amp;nbsp; vendors&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; products&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; versions&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;host1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user1&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;host2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user2&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;host3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user3&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;host4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user4&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, I'm assuming you meant for the search to look like this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2) | rename device.hostname as hostname | rename device.username as username | eval hosts = coalesce(hostnames, hostname) | eval hosts = lower(hosts) | stats values(*) as * by hosts | table hosts, username, vendors, products, versions&lt;/P&gt;&lt;P&gt;Otherwise, the search wouldn't yield any results&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 19:27:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681237#M232794</guid>
      <dc:creator>psomeshwar</dc:creator>
      <dc:date>2024-03-19T19:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to add a field from another searched index to a finished table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681243#M232796</link>
      <description>&lt;P&gt;Ack, seems I forgot to rename the hostname field to hosts, thus ruining the stats.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index1 sourcetype=sourcetype1) OR (index=index2 sourcetype=sourcetype2)
| rename device.hostname as hosts
| rename device.username as username      
| eval hosts = lower(hosts)
| stats values(*) as * by hosts
| table hosts, username, vendors, products, versions&lt;/LI-CODE&gt;&lt;P&gt;The trick is to get the hosts values (e.g. HOST1 and host1) to be in the same case (hence the lower()), then if you do "stats values(*) as * by host" , then it will put together all the values for the other columns on one row for each unique value of hosts. One for host1, one for host2, and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 19:56:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681243#M232796</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-03-19T19:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to add a field from another searched index to a finished table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681246#M232797</link>
      <description>&lt;P&gt;When trying this, the result was the same as the previous attempt, only the hosts and username fields populating&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 20:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681246#M232797</guid>
      <dc:creator>psomeshwar</dc:creator>
      <dc:date>2024-03-19T20:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to add a field from another searched index to a finished table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681248#M232798</link>
      <description>&lt;P&gt;This could be caused because the host values are not becoming equal. Could you try your initial search but with the "| eval hosts = lower(hosts)" command at the end?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 20:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-add-a-field-from-another-searched-index-to-a-finished/m-p/681248#M232798</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-03-19T20:10:43Z</dc:date>
    </item>
  </channel>
</rss>

