<?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: Two index related inquiries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312230#M160135</link>
    <description>&lt;P&gt;@kulo, Can you please confirm the exact field names/values because they are crucial for us to assist you with exact query. Based on your data examples seems like field names field1 and field2 are the same in two indexes A and B but have different values.&lt;/P&gt;

&lt;P&gt;For example field1 in indexA contains partial URL and field1 in indexB containing complete URL. Also field2 in indexA contains IP and field2 in indexB contains some tag name.&lt;/P&gt;

&lt;P&gt;Please confirm and add exact data (mock/anonymize if necessary).&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jul 2017 05:51:39 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-07-24T05:51:39Z</dc:date>
    <item>
      <title>Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312224#M160129</link>
      <description>&lt;P&gt;I now have two index needs related inquiries, which indexB the B field is a subset of A field of indexA, how do I change this&lt;BR /&gt;
The two index events are as follows&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3207i921626DB42B04C54/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I want to achieve the following effect&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3208i7DE4D2DBCE198EE9/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 08:28:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312224#M160129</guid>
      <dc:creator>kulo</dc:creator>
      <dc:date>2017-07-13T08:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312225#M160130</link>
      <description>&lt;P&gt;Hi Kulo,&lt;BR /&gt;
could you share more details?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 08:32:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312225#M160130</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-13T08:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312226#M160131</link>
      <description>&lt;P&gt;I now want to achieve the effect is that if the indexA field1 is equal to the indexB field1, the output indexA field2 and indexB field2&lt;/P&gt;

&lt;P&gt;The two indexes are as follows：&lt;/P&gt;

&lt;P&gt;indexA &lt;/P&gt;

&lt;P&gt;field1   field2 &lt;BR /&gt;
abc.com  192.168.0.1&lt;/P&gt;

&lt;P&gt;indexB &lt;/P&gt;

&lt;P&gt;field1      field2&lt;BR /&gt;
abc.com     malwaredomain&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 09:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312226#M160131</guid>
      <dc:creator>kulo</dc:creator>
      <dc:date>2017-07-13T09:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312227#M160132</link>
      <description>&lt;P&gt;Hi Kulo,,&lt;BR /&gt;
there are many ways to do that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA 
| rename field1 AS field field2 AS "A.field2"
| join field [ search index=indexB | rename field1 AS field field2 AS "B.fields2"| fields field "B.fields2" ]
| table field "A.field2" "B.fields2"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Obvioulsy, you don't nee to rename field1 if it has the same name in both the indexes and your don't need to rename field2 if has different field names in the two indexes.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 09:16:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312227#M160132</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-13T09:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312228#M160133</link>
      <description>&lt;P&gt;I want to do is to indexA field1 and indexB field1 to do comparison, and indexA file1 for indexB field1 subset.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;indexA

field1 field2 
abc.com 192.168.0.1


indexB

field1 field2
*.abc.com*  malwaredomain
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2017 09:15:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312228#M160133</guid>
      <dc:creator>kulo</dc:creator>
      <dc:date>2017-07-21T09:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312229#M160134</link>
      <description>&lt;P&gt;Are you sayng that in indexA.field1 you have only domain (abc.com) and in indexB.field1 you have  the full url (/aaa.abc.com)?&lt;BR /&gt;
and you want to compare indexA.field1 (abc.com) with indexB.field1  (aaa.abc.com)?&lt;BR /&gt;
if this is you need, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA 
 | rename field1 AS field field2 AS "A.field2"
 | join field [ search index=indexB | rex field=field1 ".*\.(?&amp;lt;field&amp;gt;\w*\.\w*)" | rename field2 AS "B.fields2" | fields field "B.fields2" ]
 | table field "A.field2" "B.fields2"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 09:56:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312229#M160134</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-21T09:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312230#M160135</link>
      <description>&lt;P&gt;@kulo, Can you please confirm the exact field names/values because they are crucial for us to assist you with exact query. Based on your data examples seems like field names field1 and field2 are the same in two indexes A and B but have different values.&lt;/P&gt;

&lt;P&gt;For example field1 in indexA contains partial URL and field1 in indexB containing complete URL. Also field2 in indexA contains IP and field2 in indexB contains some tag name.&lt;/P&gt;

&lt;P&gt;Please confirm and add exact data (mock/anonymize if necessary).&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 05:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312230#M160135</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-24T05:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312231#M160136</link>
      <description>&lt;P&gt;I updated my question, trouble everyone to help look at&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 06:59:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312231#M160136</guid>
      <dc:creator>kulo</dc:creator>
      <dc:date>2017-07-26T06:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312232#M160137</link>
      <description>&lt;P&gt;I updated my question, trouble everyone to help look at&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 07:02:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312232#M160137</guid>
      <dc:creator>kulo</dc:creator>
      <dc:date>2017-07-26T07:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312233#M160138</link>
      <description>&lt;P&gt;There are many ways:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA OR indexB
| stats values(category) AS category by domain src_ip
| table src_ip domain category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA
| join domain [search index=index2]
| table src_ip domain category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I prefer first chioice.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 07:25:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312233#M160138</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-26T07:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312234#M160139</link>
      <description>&lt;P&gt;I would like to query with domain for comparison, if they are equal, the output src_ip, domain, category&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 07:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312234#M160139</guid>
      <dc:creator>kulo</dc:creator>
      <dc:date>2017-07-26T07:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312235#M160140</link>
      <description>&lt;P&gt;try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=indexA OR indexB
 | stats values(src_ip) AS src_ip values(category) AS category by domain
 | table src_ip domain category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in this way you could have more IPs for each domain, instead in the first solution you have a couple domain IP.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 07:55:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312235#M160140</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-26T07:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312236#M160141</link>
      <description>&lt;P&gt;Create &lt;CODE&gt;Field Alias&lt;/CODE&gt; for csv sourcetype to rename field &lt;STRONG&gt;domain&lt;/STRONG&gt; as &lt;STRONG&gt;query&lt;/STRONG&gt;. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Addaliasestofields"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Addaliasestofields&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=dns OR index=malware_domain
| stats values(src_ip) as src_ip values(category) as category by query
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jul 2017 08:59:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312236#M160141</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-26T08:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Two index related inquiries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312237#M160142</link>
      <description>&lt;P&gt;Here's a couple of other ways you could try...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch 
    [search index=dsn (other search terms) | fields src_ip query | rename query as domain]
    [search index=malware (other search terms) | fields domain category]
| stats values(*) as * by domain


index=dsn (other search terms) | fields src_ip query | rename query as domain
| join type=left domain [index=malware (other search terms) | fields domain category]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jul 2017 19:33:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-index-related-inquiries/m-p/312237#M160142</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-26T19:33:39Z</dc:date>
    </item>
  </channel>
</rss>

