<?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: Using data model inside subsearches in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Using-data-model-inside-subsearches/m-p/410729#M7113</link>
    <description>&lt;P&gt;*this answer means &lt;A href="https://answers.splunk.com/answers/151315/how-to-find-differences-between-two-searches-with-set-diff-command.html"&gt;https://answers.splunk.com/answers/151315/how-to-find-differences-between-two-searches-with-set-diff-command.htm&lt;/A&gt;l&lt;/P&gt;</description>
    <pubDate>Fri, 25 May 2018 10:22:14 GMT</pubDate>
    <dc:creator>adrab</dc:creator>
    <dc:date>2018-05-25T10:22:14Z</dc:date>
    <item>
      <title>Using data model inside subsearches</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-data-model-inside-subsearches/m-p/410728#M7112</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I'm working on analysis of data coming  from some web scan app. &lt;BR /&gt;
I have to compare the results from two scan executions. Inspired by &lt;A href="https://answers.splunk.com/answers/151315/how-to-find-differences-between-two-searches-with-set-diff-command.html" target="_blank"&gt;this answer&lt;/A&gt; I've got this working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| set diff [search index=webscan sourcetype=webscan message="Done exchange {exchange}" scanId=110cf971-c319-41dc-b58c-670f4c141cf1 execId=2018-05-24T20:59:18| stats count by eventProperties.exchange.PluginId, eventProperties.exchange.Url | table eventProperties.exchange.PluginId, eventProperties.exchange.Url] [search index=webscan sourcetype=webscan message="Done exchange {exchange}" scanId=110cf971-c319-41dc-b58c-670f4c141cf1 execId=2018-05-24T18:57:32 | stats count by eventProperties.exchange.PluginId, eventProperties.exchange.Url | table eventProperties.exchange.PluginId, eventProperties.exchange.Url]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem appears when I try to use a data model in subsearches - the following does not work (shows "No results found"):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| set diff [| datamodel WebScan Exchanges search | search scanId=110cf971-c319-41dc-b58c-670f4c141cf1 execId=2018-05-24T20:59:18| stats count by eventProperties.exchange.PluginId, eventProperties.exchange.Url | table eventProperties.exchange.PluginId, eventProperties.exchange.Url] [| datamodel WebScan Exchanges search | search scanId=110cf971-c319-41dc-b58c-670f4c141cf1 execId=2018-05-24T18:57:32 | stats count by eventProperties.exchange.PluginId, eventProperties.exchange.Url | table eventProperties.exchange.PluginId, eventProperties.exchange.Url]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in spite of the fact that subsearches run separatly works as expected.&lt;BR /&gt;
What should be changed?&lt;/P&gt;

&lt;P&gt;Ultimately, I would like to define a macro &lt;EM&gt;exchanges_of(2)&lt;/EM&gt; like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;datamodel WebScan Exchanges search | search scanId=$scanId$, execId=$execId$ | stats count by eventProperties.exchange.PluginId, eventProperties.exchange.Url | table eventProperties.exchange.PluginId, eventProperties.exchange.Url
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| set diff [|`exchanges_of(110cf971-c319-41dc-b58c-670f4c141cf1, 2018-05-24T20:59:18)`] [|`exchanges_of(110cf971-c319-41dc-b58c-670f4c141cf1,2018-05-24T18:57:32)`]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but this also returns "No results found."&lt;/P&gt;

&lt;P&gt;And it would be great if I could do something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| `exchanges_of(110cf971-c319-41dc-b58c-670f4c141cf1, 2018-05-24T20:59:18)` NOT  [|`exchanges_of(110cf971-c319-41dc-b58c-670f4c141cf1,2018-05-24T18:57:32)`]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for "one side" diff. Is it possible?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:37:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-data-model-inside-subsearches/m-p/410728#M7112</guid>
      <dc:creator>adrab</dc:creator>
      <dc:date>2020-09-29T19:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using data model inside subsearches</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-data-model-inside-subsearches/m-p/410729#M7113</link>
      <description>&lt;P&gt;*this answer means &lt;A href="https://answers.splunk.com/answers/151315/how-to-find-differences-between-two-searches-with-set-diff-command.html"&gt;https://answers.splunk.com/answers/151315/how-to-find-differences-between-two-searches-with-set-diff-command.htm&lt;/A&gt;l&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 10:22:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-data-model-inside-subsearches/m-p/410729#M7113</guid>
      <dc:creator>adrab</dc:creator>
      <dc:date>2018-05-25T10:22:14Z</dc:date>
    </item>
  </channel>
</rss>

