<?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 search on multiple indexes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95108#M24554</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have two indexes: index1, index2.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index1 has a field 'Message' which index2 doesn't have.&lt;/STRONG&gt;&lt;BR /&gt;
There are duplicated messages that I'd like to dedup by |dedup Message.&lt;/P&gt;

&lt;P&gt;I'd like to find the records with text "TextToFind" across the 2 indexes but not to get multiple records for the duplicated 'Message' field.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;index=index1 TextToFind&lt;/STRONG&gt; returns 94 results (appear in field &lt;STRONG&gt;Message&lt;/STRONG&gt;)&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;index=index2 TextToFind&lt;/STRONG&gt; returns 8 results (appear in field &lt;STRONG&gt;Content&lt;/STRONG&gt;)&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;(index=index1) OR (index=index2) TextToFind&lt;/STRONG&gt; returns 102 results&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;(index=index1) OR (index=index2)  TextToFind | dedup Message&lt;/STRONG&gt; returns 2 results from index1 only although the TextToFind appears on index2 as well (in field Content).&lt;/P&gt;

&lt;P&gt;Could you please fix my query?&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jul 2013 10:42:38 GMT</pubDate>
    <dc:creator>avitallange</dc:creator>
    <dc:date>2013-07-15T10:42:38Z</dc:date>
    <item>
      <title>search on multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95108#M24554</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have two indexes: index1, index2.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index1 has a field 'Message' which index2 doesn't have.&lt;/STRONG&gt;&lt;BR /&gt;
There are duplicated messages that I'd like to dedup by |dedup Message.&lt;/P&gt;

&lt;P&gt;I'd like to find the records with text "TextToFind" across the 2 indexes but not to get multiple records for the duplicated 'Message' field.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;index=index1 TextToFind&lt;/STRONG&gt; returns 94 results (appear in field &lt;STRONG&gt;Message&lt;/STRONG&gt;)&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;index=index2 TextToFind&lt;/STRONG&gt; returns 8 results (appear in field &lt;STRONG&gt;Content&lt;/STRONG&gt;)&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;(index=index1) OR (index=index2) TextToFind&lt;/STRONG&gt; returns 102 results&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;(index=index1) OR (index=index2)  TextToFind | dedup Message&lt;/STRONG&gt; returns 2 results from index1 only although the TextToFind appears on index2 as well (in field Content).&lt;/P&gt;

&lt;P&gt;Could you please fix my query?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2013 10:42:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95108#M24554</guid>
      <dc:creator>avitallange</dc:creator>
      <dc:date>2013-07-15T10:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: search on multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95109#M24555</link>
      <description>&lt;P&gt;If your first search works but your second search returns 0 results, that's because there is no field called Message in your search.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2013 12:28:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95109#M24555</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-07-15T12:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: search on multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95110#M24556</link>
      <description>&lt;P&gt;Is the text you are looking for in index1's message field or is it in a different field?&lt;BR /&gt;
if so you could use the eval and coalesce functions (&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/CommonEvalFunctions&lt;/A&gt;) to put them into a new, single field and then dedup.  If the text you are looking for isn't in index1's Message field not sure of your best option other than some of the join/subsearch type functions&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2013 13:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95110#M24556</guid>
      <dc:creator>samhughe</dc:creator>
      <dc:date>2013-07-15T13:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: search on multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95111#M24557</link>
      <description>&lt;P&gt;I have a field called Message, I see in the left pane with many other fields. You are right, I got results but I still can't query what I want. I updated my question above.&lt;BR /&gt;
Your help is welcome!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2013 15:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95111#M24557</guid>
      <dc:creator>avitallange</dc:creator>
      <dc:date>2013-07-15T15:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: search on multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95112#M24558</link>
      <description>&lt;P&gt;Yes, the test I am looking for is in index1's Message field.&lt;BR /&gt;
It also appears on index2's Content field.&lt;BR /&gt;
I updated my question above.&lt;BR /&gt;
Your help is welcome!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2013 15:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95112#M24558</guid>
      <dc:creator>avitallange</dc:creator>
      <dc:date>2013-07-15T15:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: search on multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95113#M24559</link>
      <description>&lt;P&gt;Based on your additional comments, try:&lt;BR /&gt;
(index=index1) OR (index=index2) TextToFind | eval newField=coalesce(Message,Content) | dedup newField&lt;/P&gt;

&lt;P&gt;Assuming there are no duplicates of 'Content' you want to keep.&lt;/P&gt;

&lt;P&gt;Or probably the better option is to use the keepempty=true parameter for dedup: &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Dedup"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Dedup&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2013 15:08:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95113#M24559</guid>
      <dc:creator>samhughe</dc:creator>
      <dc:date>2013-07-15T15:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: search on multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95114#M24560</link>
      <description>&lt;P&gt;See hamhughe's answer which I think is spot on.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2013 15:24:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95114#M24560</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-07-15T15:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: search on multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95115#M24561</link>
      <description>&lt;P&gt;It worked with the keepempty=true, thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2013 18:55:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-on-multiple-indexes/m-p/95115#M24561</guid>
      <dc:creator>avitallange</dc:creator>
      <dc:date>2013-07-15T18:55:07Z</dc:date>
    </item>
  </channel>
</rss>

