<?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 correlate two JSON objects via a key-value pair? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-two-JSON-objects-via-a-key-value-pair/m-p/274994#M82948</link>
    <description>&lt;P&gt;I found the answer below at Stack Overflow: &lt;A href="http://stackoverflow.com/a/41109872/5415084"&gt;http://stackoverflow.com/a/41109872/5415084&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You want to use the transaction filter here, &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Transaction"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Transaction&lt;/A&gt; &lt;BR /&gt;
This won't gracefully merge your json in _raw, but it will make the properties available to query/chart upon.&lt;/P&gt;

&lt;P&gt;In this example, I assume you want to merge events by the time property, since that is the only matching field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=test_drive (DO THE MAGIC) | eval first_distance=distance(#44) | eval second_distance=distance(#323) | transaction time | table time first_distance(#323) second_distance(#44)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Dec 2016 21:29:30 GMT</pubDate>
    <dc:creator>Leustad</dc:creator>
    <dc:date>2016-12-12T21:29:30Z</dc:date>
    <item>
      <title>How to correlate two JSON objects via a key-value pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-two-JSON-objects-via-a-key-value-pair/m-p/274993#M82947</link>
      <description>&lt;P&gt;Imagine there are thousands of JSON entries and I want to correlate object pairs via a key/value pair.&lt;/P&gt;

&lt;P&gt;Entry #44&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    speed: 55,
    distance: 18,
    time: 1481216486,
    color: red,
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Entry #323&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    speed: 75,
    distance: 38,
    time: 1481216486,
    color: blue,
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=test_drive (DO THE MAGIC) | eval first_distance=distance(#44) | eval second_distance=distance(#323) | table time first_distance(#323) second_distance(#44)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So basically I'm trying to find an entry pair via a key/value pair and use another key/value pair from the entry pair and create a table. &lt;/P&gt;

&lt;P&gt;Sorry for the horrible formatting. Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 17:10:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-two-JSON-objects-via-a-key-value-pair/m-p/274993#M82947</guid>
      <dc:creator>Leustad</dc:creator>
      <dc:date>2016-12-08T17:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate two JSON objects via a key-value pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-two-JSON-objects-via-a-key-value-pair/m-p/274994#M82948</link>
      <description>&lt;P&gt;I found the answer below at Stack Overflow: &lt;A href="http://stackoverflow.com/a/41109872/5415084"&gt;http://stackoverflow.com/a/41109872/5415084&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You want to use the transaction filter here, &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Transaction"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Transaction&lt;/A&gt; &lt;BR /&gt;
This won't gracefully merge your json in _raw, but it will make the properties available to query/chart upon.&lt;/P&gt;

&lt;P&gt;In this example, I assume you want to merge events by the time property, since that is the only matching field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=test_drive (DO THE MAGIC) | eval first_distance=distance(#44) | eval second_distance=distance(#323) | transaction time | table time first_distance(#323) second_distance(#44)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Dec 2016 21:29:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-two-JSON-objects-via-a-key-value-pair/m-p/274994#M82948</guid>
      <dc:creator>Leustad</dc:creator>
      <dc:date>2016-12-12T21:29:30Z</dc:date>
    </item>
  </channel>
</rss>

