<?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 Joining 2 Indexes by JSESSION in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245481#M73170</link>
    <description>&lt;P&gt;I have 2 indexes which both have a common filed (JSESSIONID).. One index has an IndexOutOfBoundsException and another index has the user agent string along with the web request. So I want to join these 2 indexes by their JSESSIONID so I have 1 event which is made up of both the &lt;CODE&gt;index=main&lt;/CODE&gt; and &lt;CODE&gt;index=web-access&lt;/CODE&gt; .. Once I have this event I can then find out how many of those IndexOutOfBoundsExceptions were bots or humans by looking at their web request and user agent string. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Index=main&lt;/CODE&gt; has &lt;CODE&gt;indexoutofboundsexception&lt;/CODE&gt; and the &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; but does not include the web request or user agent string.. &lt;BR /&gt;
&lt;CODE&gt;index=web-access&lt;/CODE&gt; has the User Agent string/Web Request and the &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; but does not include the &lt;CODE&gt;indexoutofboundsexception&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Here's my current search that is not working&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main AND index=web-access | transaction   JSESSIONID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Nov 2015 14:24:46 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2015-11-25T14:24:46Z</dc:date>
    <item>
      <title>Joining 2 Indexes by JSESSION</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245481#M73170</link>
      <description>&lt;P&gt;I have 2 indexes which both have a common filed (JSESSIONID).. One index has an IndexOutOfBoundsException and another index has the user agent string along with the web request. So I want to join these 2 indexes by their JSESSIONID so I have 1 event which is made up of both the &lt;CODE&gt;index=main&lt;/CODE&gt; and &lt;CODE&gt;index=web-access&lt;/CODE&gt; .. Once I have this event I can then find out how many of those IndexOutOfBoundsExceptions were bots or humans by looking at their web request and user agent string. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Index=main&lt;/CODE&gt; has &lt;CODE&gt;indexoutofboundsexception&lt;/CODE&gt; and the &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; but does not include the web request or user agent string.. &lt;BR /&gt;
&lt;CODE&gt;index=web-access&lt;/CODE&gt; has the User Agent string/Web Request and the &lt;CODE&gt;JSESSIONID&lt;/CODE&gt; but does not include the &lt;CODE&gt;indexoutofboundsexception&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Here's my current search that is not working&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main AND index=web-access | transaction   JSESSIONID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Nov 2015 14:24:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245481#M73170</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-11-25T14:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Joining 2 Indexes by JSESSION</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245482#M73171</link>
      <description>&lt;P&gt;Try this (change fieldnames to suit)&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main OR index=web-access | stats values(indexoutofboundsexception) values(useragentstring) by JSESSIONID&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Generally if you have a unique ID you shouldn't need transaction. Use stats instead. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 14:34:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245482#M73171</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-11-25T14:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Joining 2 Indexes by JSESSION</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245483#M73172</link>
      <description>&lt;P&gt;The user agent string is not an extracted field.. Also I'm not sure how this could work if we're using and AND statement to join the indexes when the indexoutofboundsexception is only present in the index=main.. Wouldn't we always get 'No Results Found' if the value is in one index and we use an AND to join 2 indexes? &lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 14:47:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245483#M73172</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-11-25T14:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Joining 2 Indexes by JSESSION</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245484#M73173</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=main OR index=web-access | stats values(*) AS * BY JSESSIONID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Go on (piping) from there.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 14:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245484#M73173</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-25T14:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Joining 2 Indexes by JSESSION</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245485#M73174</link>
      <description>&lt;P&gt;Silly me, I missed the AND in your initial search. Assuming the JSESSIONID is present in every event you are interested in, try something more like this. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(index=main OR index=web-access) AND JSESSIONID=* | stats values(*) by JSESSIONID&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Using index=x AND index=y will actually return no events. Unless you have events with more than one index field, which I'm not sure is possible? (Not 100% certain there but I wouldn't think it is). Its not actually joining the indices, but telling splunk to give you every event where the index field is BOTH main and web-access. Instead you want to get splunk to give you all the events from the main and web-access indices that have a value for JSESSIONID, then aggregate all the field values for those events based on their JSESSIONID. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 15:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245485#M73174</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-11-25T15:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Joining 2 Indexes by JSESSION</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245486#M73175</link>
      <description>&lt;P&gt;This does return results, but the events return one index each rather than 2 indexes for each event.&lt;/P&gt;

&lt;P&gt;So what I'm looking for is an event to have both &lt;CODE&gt;index=main&lt;/CODE&gt; and &lt;CODE&gt;index=web-access&lt;/CODE&gt; as the same event. Both indexes will have the same JSESSIONID&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 16:29:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245486#M73175</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-11-25T16:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Joining 2 Indexes by JSESSION</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245487#M73176</link>
      <description>&lt;P&gt;Can you update your question with an example of each event, and perhaps an example of what you want the final table to look like?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 16:40:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245487#M73176</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-11-25T16:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Joining 2 Indexes by JSESSION</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245488#M73177</link>
      <description>&lt;P&gt;Did you try my &lt;EM&gt;entire&lt;/EM&gt; answer ( &lt;CODE&gt;index=main OR index=web-access | stats values(*) AS * BY JSESSIONID&lt;/CODE&gt; )?  It does &lt;EM&gt;exactly&lt;/EM&gt; what you are saying that you need!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 16:45:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-2-Indexes-by-JSESSION/m-p/245488#M73177</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-25T16:45:48Z</dc:date>
    </item>
  </channel>
</rss>

