<?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: How to combine two events based on common field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397685#M167959</link>
    <description>&lt;P&gt;try &lt;CODE&gt;Size&lt;/CODE&gt; i hade it with CAPITAL &lt;CODE&gt;I&lt;/CODE&gt; there by accident&lt;/P&gt;</description>
    <pubDate>Thu, 09 Aug 2018 18:32:34 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2018-08-09T18:32:34Z</dc:date>
    <item>
      <title>How to combine two events based on common field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397682#M167956</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;I am using splunk for about two week at my work and I have task to build dashboard. I have splunk query that extracts data from 2 different events but in the same source. The events share common ID.  I am trying to combine the events based on the ID and represent the data from both events in a dashboard. I tried with multisearch and by. None of them worked. Can anyone give me a hit on how to approach this problem? Here is the query and a screen shot from the result: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=?????? sourcetype=???? host=????? source=????????? "Number of Clients" OR "Duration::  in " 
              | rex field=_raw "Number of Clients: (?&amp;lt;ClientCount&amp;gt;\d+)"
              | rex field=_raw "cid:(?&amp;lt;CID&amp;gt;\w+-\w+-\w+-\w+-\w+)" 
              | rex field=_raw "Duration::  in (?&amp;lt;Duration&amp;gt;\d+.\d+)"
              | eval Size = if(ClientCount == 0, "Not part of association", if(ClientCount &amp;lt;= 3, "Small", if(ClientCount &amp;lt;= 10 ,"Medium",if (ClientCount &amp;gt; 10, "Large", ClientCount))))
              | table Size Duration CID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&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/5528i119AB37AF9A6258E/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, 09 Aug 2018 14:33:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397682#M167956</guid>
      <dc:creator>dminev1</dc:creator>
      <dc:date>2018-08-09T14:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two events based on common field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397683#M167957</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=?????? sourcetype=???? host=????? source=????????? "Number of Clients" OR "Duration:: in " 
| rex field=_raw "Number of Clients: (?\d+)" 
| rex field=_raw "cid:(?\w+-\w+-\w+-\w+-\w+)" 
| rex field=_raw "Duration:: in (?\d+.\d+)" 
| eval Size = if(ClientCount == 0, "Not part of association", if(ClientCount &amp;lt;= 3, "Small", if(ClientCount &amp;lt;= 10 ,"Medium",if (ClientCount &amp;gt; 10, "Large", ClientCount)))) 
| stats values(CID) as CID by  Duration SIze
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Aug 2018 17:21:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397683#M167957</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2018-08-09T17:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two events based on common field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397684#M167958</link>
      <description>&lt;P&gt;Doesn't return any result. Thanks for the reply.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 17:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397684#M167958</guid>
      <dc:creator>dminev1</dc:creator>
      <dc:date>2018-08-09T17:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two events based on common field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397685#M167959</link>
      <description>&lt;P&gt;try &lt;CODE&gt;Size&lt;/CODE&gt; i hade it with CAPITAL &lt;CODE&gt;I&lt;/CODE&gt; there by accident&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 18:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397685#M167959</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2018-08-09T18:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two events based on common field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397686#M167960</link>
      <description>&lt;P&gt;Got it working. Here is the solution&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=??? sourcetype=??? host=???? source=???? ("Number of Clients" OR "Duration::  in ")
              | rex field=_raw "Number of Clients: (?&amp;lt;ClientCount&amp;gt;\d+)"
              | rex field=_raw "cid:(?&amp;lt;CID&amp;gt;\w+-\w+-\w+-\w+-\w+)" 
              | rex field=_raw "Duration::  in (?&amp;lt;Duration&amp;gt;\d+.\d+)"
              | eval Size = if(ClientCount == 0, "Not part of association", if(ClientCount &amp;lt;= 3, "Small", if(ClientCount &amp;lt;= 10 ,"Medium",if (ClientCount &amp;gt; 10, "Large", ClientCount))))
              | stats values(Duration) as Duration values(Size) as Size by CID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Aug 2018 20:20:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397686#M167960</guid>
      <dc:creator>dminev1</dc:creator>
      <dc:date>2018-08-09T20:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two events based on common field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397687#M167961</link>
      <description>&lt;P&gt;very good,&lt;BR /&gt;
if it works for you, kindly mark the answer as accepted, and  upvote ant helpful comments if any so others will know this solution worked for you.&lt;/P&gt;

&lt;P&gt;thanks and happy splunking!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 20:33:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-events-based-on-common-field/m-p/397687#M167961</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2018-08-09T20:33:00Z</dc:date>
    </item>
  </channel>
</rss>

