<?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: Combine two source types using data models and join in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311082#M4185</link>
    <description>&lt;P&gt;Thanks for your reply! &lt;/P&gt;

&lt;P&gt;I get this error when switching rows of datamodel and subsearch or trying datamodel as a subsearch: "Error in 'SearchParser': The datamodel command can only be used as the first command on a search'.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2017 13:17:00 GMT</pubDate>
    <dc:creator>Ojay87</dc:creator>
    <dc:date>2017-10-19T13:17:00Z</dc:date>
    <item>
      <title>Combine two source types using data models and join</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311080#M4183</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;

&lt;P&gt;In Enterprise Security I am trying to combine results from two different source types by using "join" but facing problem with subsearch limits. My goal is to make a statistic table where the traffic data is coming from another log, but this traffic log is huge even if I narrow the search for one hour. All I really need is just fields "bytes_in" and "bytes_out" from traffic log, but now it is collecting everything. I have tried narrow the subsearch results, but not yet successfully. &lt;/P&gt;

&lt;P&gt;Below search is the very basic setup which would work without any limits, but I cannot change them. Looking for any ideas how to bypass it. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| datamodel datamodel1 search | search attack="vulnerability1"
| join src_ip type=left overwrite=false [search index=logs sourcetype=traffic_log ] 
| stats sum(eval(round(bytes_in(1024*1024),2))) AS "Incoming Mb" sum(eval(round(bytes_out/(1024*1024),2))) AS "Outgoing Mb" by src_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311080#M4183</guid>
      <dc:creator>Ojay87</dc:creator>
      <dc:date>2020-09-29T16:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two source types using data models and join</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311081#M4184</link>
      <description>&lt;P&gt;how much data is in the datamodel? if you flipped them around and had the datamodel as a subsearch, would you still run into limitations? Is there a way you can do some aggregations inside the subsearch as well as to the base search to limit the amount of events?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 13:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311081#M4184</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-19T13:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two source types using data models and join</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311082#M4185</link>
      <description>&lt;P&gt;Thanks for your reply! &lt;/P&gt;

&lt;P&gt;I get this error when switching rows of datamodel and subsearch or trying datamodel as a subsearch: "Error in 'SearchParser': The datamodel command can only be used as the first command on a search'.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 13:17:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311082#M4185</guid>
      <dc:creator>Ojay87</dc:creator>
      <dc:date>2017-10-19T13:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two source types using data models and join</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311083#M4186</link>
      <description>&lt;P&gt;that shouldn't be a problem. just make sure it's formatted properly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=logs sourcetype=traffic_log|join src_ip type=left overwrite=false [| datamodel datamodelname datasetname search | search attack="vulnerability1"]| stats sum(eval(round(bytes_in(1024*1024),2))) AS "Incoming Mb" sum(eval(round(bytes_out/(1024*1024),2))) AS "Outgoing Mb" by src_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the problem might come with the datamodel timing out, perhaps, but it can be used as a subsearch, it is the first command in the search (the subsearch is it's own search).&lt;/P&gt;

&lt;P&gt;have you tried using the pivot command instead? is the datamodel accelerated? again, is there a way to aggregate either before joining them together on the raw events? perhaps by summing the bytes in and out by src_ip in the traffic_log and using the datamodel/pivot as a subsearch with a distinct list of src_ip that had vulnerable attacks? (i'm completely guessing that that is what your datamodel is there for)&lt;/P&gt;

&lt;P&gt;also, if you did the aggregate of bytes in/out by src_ip in the subsearch, you might not run into the limitation.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311083#M4186</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-29T16:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two source types using data models and join</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311084#M4187</link>
      <description>&lt;P&gt;Assumption 1:  You need &lt;CODE&gt;bytes_in&lt;/CODE&gt; and &lt;CODE&gt;bytes_out&lt;/CODE&gt; from traffic_log. But you only need that information if the &lt;CODE&gt;src_ip&lt;/CODE&gt; is in the datamodel and marked as &lt;CODE&gt;"vulnerability1"&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Assumption 2:  The frequency of &lt;CODE&gt;src_ip&lt;/CODE&gt; in the datamodel and marked as &lt;CODE&gt;"vulnerability1"&lt;/CODE&gt; in traffic_log are low/sparse relative to the total number of  &lt;CODE&gt;src_p&lt;/CODE&gt; in traffic_log.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=logs sourcetype=traffic_log 
  [| datamodel datamodel1 search | search attack="vulnerability1" | dedup src_ip | table src_ip]
| stats sum(eval(round(bytes_in/(1024*1024),2))) AS "Incoming Mb" 
        sum(eval(round(bytes_out/(1024*1024),2))) AS "Outgoing Mb" by src_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:17:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311084#M4187</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-09-29T16:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two source types using data models and join</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311085#M4188</link>
      <description>&lt;P&gt;Thanks, you were right. I wrote the commands incorrectly. Now, it works how I wanted! Many thanks for your support here!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 07:43:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311085#M4188</guid>
      <dc:creator>Ojay87</dc:creator>
      <dc:date>2017-10-20T07:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two source types using data models and join</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311086#M4189</link>
      <description>&lt;P&gt;Thank you for your reply! This is what I wanted as you described in your first assumption.&lt;/P&gt;

&lt;P&gt;This was very helpful. Now it works! &lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 07:47:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311086#M4189</guid>
      <dc:creator>Ojay87</dc:creator>
      <dc:date>2017-10-20T07:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two source types using data models and join</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311087#M4190</link>
      <description>&lt;P&gt;@ojay87 - We're glad to help.  Please accept the answer, so the question will show as closed.  &lt;/P&gt;

&lt;P&gt;Or instead, if @cmerriman's answer was the one that did the trick, rather than mine, then please let us know and we can convert her comment to an answer so you can accept that instead.  We're all family around here.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 17:14:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-two-source-types-using-data-models-and-join/m-p/311087#M4190</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-20T17:14:21Z</dc:date>
    </item>
  </channel>
</rss>

