<?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 match 2 data sets in JSON events using one common field in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685236#M56114</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; , i considered 1,0 and and put condition like this. But still i am not able to set the token. Is this implementation correct?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;done&amp;gt;
      &amp;lt;condition match="match(has_runtime,&amp;amp;quot;1&amp;amp;quot;)"&amp;gt;
        &amp;lt;set token="tok_runtime"&amp;gt;true&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition match="match(has_runtime,&amp;amp;quot;0&amp;amp;quot;)"&amp;gt;
        &amp;lt;unset token="tok_runtime"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 04:17:24 GMT</pubDate>
    <dc:creator>anooshac</dc:creator>
    <dc:date>2024-04-24T04:17:24Z</dc:date>
    <item>
      <title>How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685080#M56093</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have created a dashboard for JSON data. There are 2 sets of data in same index.&lt;/P&gt;&lt;P&gt;One is Info.metadata{} and another one is Info.runtime_data{} under same index as different events.&lt;/P&gt;&lt;P&gt;But both of the events have one common field that is "Info.Title".&lt;/P&gt;&lt;P&gt;How can i combine these 2 events?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 06:34:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685080#M56093</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2024-04-23T06:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685082#M56094</link>
      <description>&lt;P&gt;There are a number of possibilities but probably the best way would be to use stats values() by Info.Title.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 06:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685082#M56094</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-23T06:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685083#M56095</link>
      <description>&lt;P&gt;A bit more information would be useful, but this is a start and is the general technique for combining two data types on a common field&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=bla
| stats values(*) as * by Info.Title&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 06:41:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685083#M56095</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-23T06:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685090#M56098</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;,I have used stats and i was able to match the data.&lt;/P&gt;&lt;P&gt;I want to do one more implementation. I want to se t token based on the availability of Info.runtime_data{}. For every event there will not be Info.runtime_data{}. I want to set a token if Info.runtime_data{} is present in the event of Info.Title, if not present i want to unset that token. I have tried it in the search query using if condition. But i am not able to implement it in the dashboard.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;
     index="abc" sourcetype="abc"  Info.Title="$Title$"
     |spath output=Runtime_data path=Info.runtime_data
     | eval has_runtime = if(isnotnull(Runtime_data), "Yes", "No")
      | table _time, has_runtime
    &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;condition match="has_runtime=Yes"&amp;gt;
        &amp;lt;set token="tok_runtime"&amp;gt;true&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition match="has_runtime=No"&amp;gt;
        &amp;lt;unset token="tok_runtime"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;This is my code, i am not sure the Condition match is correct or not. But im not able to set or unset the token. Please suggest me anything.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 09:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685090#M56098</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2024-04-23T09:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685101#M56099</link>
      <description>&lt;P&gt;In the done handler, you only have access to the first row of the results, so you would only be able to set a token based on the first result. Is this what you are actually trying to do?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 10:15:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685101#M56099</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-23T10:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685107#M56100</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;, yes im trying to set a token based on the value has_runtime. Since i want to show some charts only if that particular data is present.&amp;nbsp; For this i am trying to create a token so that i can use this to show or hide the charts.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 10:45:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685107#M56100</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2024-04-23T10:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685136#M56102</link>
      <description>&lt;P&gt;In that case you could rework your search so that it has either zero or 1 row depending on whether the condition is met, and set your token based on the number of results returned.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 13:08:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685136#M56102</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-23T13:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685222#M56109</link>
      <description>&lt;P&gt;As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;you only have access to the first result of the table in the &amp;lt;done&amp;gt; clause, but assuming you only have a single result then you can set the token based on that very simply using &amp;lt;eval&amp;gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;done&amp;gt;
  &amp;lt;eval token="tok_runtime"&amp;gt;if($result.has_runtime$="Yes", "true", null())&amp;lt;/eval&amp;gt;
&amp;lt;/done&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;If you have multiple results, then this would work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;
     index="abc" sourcetype="abc"  Info.Title="$Title$"
     |spath output=Runtime_data path=Info.runtime_data
     | eval has_runtime = if(isnotnull(Runtime_data), 1, 0)
     | table _time, has_runtime
     | eventstats max(has_runtime) as has_runtime
    &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;eval token="tok_runtime"&amp;gt;if($result.has_runtime$&amp;gt;0, "true", null())&amp;lt;/eval&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Apr 2024 00:32:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685222#M56109</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-24T00:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685236#M56114</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; , i considered 1,0 and and put condition like this. But still i am not able to set the token. Is this implementation correct?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;done&amp;gt;
      &amp;lt;condition match="match(has_runtime,&amp;amp;quot;1&amp;amp;quot;)"&amp;gt;
        &amp;lt;set token="tok_runtime"&amp;gt;true&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition match="match(has_runtime,&amp;amp;quot;0&amp;amp;quot;)"&amp;gt;
        &amp;lt;unset token="tok_runtime"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 04:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685236#M56114</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2024-04-24T04:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685252#M56116</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30057"&gt;@anooshac&lt;/a&gt;no it's not, you need to look at the $result.has_runtime$ token - see my example&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 07:06:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685252#M56116</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-24T07:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to match 2 data sets in JSON events using one common field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685261#M56117</link>
      <description>&lt;P&gt;You have not shown anything that indicates that the search has the value you are seeking on the first row of your results. Please share your search and follow&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;'s suggestion about which token to use to retrieve the results.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 07:53:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-match-2-data-sets-in-JSON-events-using-one-common-field/m-p/685261#M56117</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-24T07:53:28Z</dc:date>
    </item>
  </channel>
</rss>

