<?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: Searching in multiple indexes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searching-in-multiple-indexes/m-p/489747#M136790</link>
    <description>&lt;P&gt;Hi @willadams,&lt;BR /&gt;
try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=software OR (index=assets source=import_assets.csv)
| rename nt_host AS server_name
| stats count BY server_name app_name
| eval status=if(count=0,"No","Yes")
| xyseries server_name app_name status
| fillnull value="No"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I cannot check your search, but this example is ok:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog | stats count BY EventCode Dominio_account
| eval status=if(count=0,"No","Yes")
| xyseries EventCode Dominio_account status
| fillnull value="No"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2019 14:11:10 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-11-26T14:11:10Z</dc:date>
    <item>
      <title>Searching in multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-in-multiple-indexes/m-p/489746#M136789</link>
      <description>&lt;P&gt;I am trying to create a search to do the following:&lt;/P&gt;

&lt;P&gt;1) Look in a table where information is tagged in a certain way&lt;BR /&gt;
2) Using the results of this search, search another index for a piece of data&lt;BR /&gt;
3) Using the results of the original search, search another index for another piece of data&lt;/P&gt;

&lt;P&gt;So my scenario is I have a list of important assets.  This can be seen as &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=assets source=import_assets.csv&lt;/CODE&gt; &amp;lt;== the value I am interested in here is the host name, so we will call the field "nt_host".  So example results&lt;/P&gt;

&lt;P&gt;SRV1&lt;BR /&gt;
SRV2&lt;BR /&gt;
SRV5&lt;/P&gt;

&lt;P&gt;I have another index that contains information about that asset.  This information may be a list of apps installed.  This can be seen as&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=software&lt;/CODE&gt; &amp;lt;== this has a specific field value that I would like to check.  This field may be "app_name" which contains a list of different apps.  If I just ran this search, the results may be&lt;/P&gt;

&lt;P&gt;server_name=SRV1&lt;BR /&gt;
app_name=Flash&lt;BR /&gt;
app_name=SUF&lt;BR /&gt;
app_name=agentx&lt;/P&gt;

&lt;P&gt;server_name=SRV2&lt;BR /&gt;
app_name=Flash&lt;BR /&gt;
app_name=SUF&lt;BR /&gt;
app_name=agentx&lt;/P&gt;

&lt;P&gt;server_name=SRV3&lt;BR /&gt;
app_name=Flash&lt;BR /&gt;
app_name=SUF&lt;BR /&gt;
app_name=agentx&lt;/P&gt;

&lt;P&gt;server_name=SRV4&lt;BR /&gt;
app_name=Flash&lt;BR /&gt;
app_name=SUF&lt;BR /&gt;
app_name=agentx&lt;/P&gt;

&lt;P&gt;server_name=SRV5&lt;BR /&gt;
app_name=Flash&lt;BR /&gt;
app_name=agentx&lt;/P&gt;

&lt;P&gt;My objective here is to create a table that shows my "important assets" have an application installed.  So my table would show "the server name", and whether the app is installed or not (this would use an eval and if match to determine a "yes" or "no".  So illustrating this&lt;/P&gt;

&lt;P&gt;[Server Name] | [App Name] | [App Name2]&lt;/P&gt;

&lt;P&gt;SRV1 | Yes | No&lt;BR /&gt;
SRV2 | Yes | Yes&lt;BR /&gt;
SRV5 | No  | Yes&lt;/P&gt;

&lt;P&gt;I have attempted the following searches but I end up with no results or a parsing job that goes forever&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=assets source=import_assets.csv | join type = inner max=0 nt_host [search index=software | rename server_name AS nt_host]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=assets source=import_assets.csv | join type = inner max=0 nt_host [search index=software | rename server_name AS nt_host | fields nt_host]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=assets source=import_assets.csv | where [search index=software | rename server_name AS nt_host | fields nt_host]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I also attempted to constrain the search by specifying a host in the first index search but this didn't end up with a result &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=assets source=import_assets.csv nt_host=SRV5 | join type = inner max=0 nt_host [search index=software | rename server_name AS nt_host]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:20:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-in-multiple-indexes/m-p/489746#M136789</guid>
      <dc:creator>willadams</dc:creator>
      <dc:date>2020-09-30T02:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Searching in multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-in-multiple-indexes/m-p/489747#M136790</link>
      <description>&lt;P&gt;Hi @willadams,&lt;BR /&gt;
try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=software OR (index=assets source=import_assets.csv)
| rename nt_host AS server_name
| stats count BY server_name app_name
| eval status=if(count=0,"No","Yes")
| xyseries server_name app_name status
| fillnull value="No"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I cannot check your search, but this example is ok:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog | stats count BY EventCode Dominio_account
| eval status=if(count=0,"No","Yes")
| xyseries EventCode Dominio_account status
| fillnull value="No"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 14:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-in-multiple-indexes/m-p/489747#M136790</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-11-26T14:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Searching in multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-in-multiple-indexes/m-p/489748#M136791</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="software" AND [ search index="assets" AND source="import_assets.csv"
| stats count by nt_host
| table nt_host
| rename nt_host AS server_name ]
| chart limit=0 count BY server_name app_name
| replace 0 WITH "NO", 1 with "YES"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Nov 2019 23:33:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-in-multiple-indexes/m-p/489748#M136791</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-26T23:33:25Z</dc:date>
    </item>
  </channel>
</rss>

