<?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 Issues with Joining: Maybe there is a better way? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Joining-Maybe-there-is-a-better-way/m-p/433485#M123744</link>
    <description>&lt;P&gt;We have the following search that stopped working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true sum(everything.rawlen) as rawBytes from datamodel=storage_billing by splunk_server,index,everything.bucketId,host 
| rename everything.* as * 
| eval rawMBytes=rawBytes/1024/1024 
| join splunk_server, bucketId 
    [ dbinspect index=* 
    | eval rawSizeMB=rawSize/1024/1024 
    | fields splunk_server, bucketId, path, state, startEpoch, endEpoch, modTime, sizeOnDiskMB,rawSizeMB ] 
| search state=cold 
| eval compression=sizeOnDiskMB/rawSizeMB, newRawMBytes = rawMBytes * compression 
| eventstats sum(rawMBytes), sum(newRawMBytes) by splunk_server, bucketId 
| eval margin_of_error= round( ( sizeOnDiskMB - 'sum(newRawMBytes)' ) / sizeOnDiskMB,4) 
| stats sum(newRawMBytes) as MBytes_Used, count(bucketId) as Bucket_Count by splunk_server,index,state,host 
| eval GBytes_Used=round(MBytes_Used/1024,2) 
| rename host as "Volume Name" 
| rename MBytes_Used as Space 
| eval "Copy Type"="Primary" 
| eval F4="Copy" 
| fields "Volume Name", Space, "Copy Type", F4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We have narrowed the issue down to &lt;CODE&gt;join splunk_server, bucketId&lt;/CODE&gt; as when we run &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true sum(everything.rawlen) as rawBytes from datamodel=storage_billing by splunk_server,index,everything.bucketId,host 
| rename everything.* as * 
| eval rawMBytes=rawBytes/1024/1024 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbinspect index=* 
| eval rawSizeMB=rawSize/1024/1024 
| fields splunk_server, bucketId, path, state, startEpoch, endEpoch, modTime, sizeOnDiskMB,rawSizeMB 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Separately, they work just fine. When we try to join then, that's when the search breaks. For reasons, this search is going back 7 years. Our current theory is that it is timing out before completion. &lt;/P&gt;

&lt;P&gt;Is there a way to streamline the search? Is &lt;CODE&gt;join&lt;/CODE&gt; the right way to do this? is there a faster, better way to do this?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jan 2019 14:59:57 GMT</pubDate>
    <dc:creator>cboillot</dc:creator>
    <dc:date>2019-01-30T14:59:57Z</dc:date>
    <item>
      <title>Issues with Joining: Maybe there is a better way?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Joining-Maybe-there-is-a-better-way/m-p/433485#M123744</link>
      <description>&lt;P&gt;We have the following search that stopped working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true sum(everything.rawlen) as rawBytes from datamodel=storage_billing by splunk_server,index,everything.bucketId,host 
| rename everything.* as * 
| eval rawMBytes=rawBytes/1024/1024 
| join splunk_server, bucketId 
    [ dbinspect index=* 
    | eval rawSizeMB=rawSize/1024/1024 
    | fields splunk_server, bucketId, path, state, startEpoch, endEpoch, modTime, sizeOnDiskMB,rawSizeMB ] 
| search state=cold 
| eval compression=sizeOnDiskMB/rawSizeMB, newRawMBytes = rawMBytes * compression 
| eventstats sum(rawMBytes), sum(newRawMBytes) by splunk_server, bucketId 
| eval margin_of_error= round( ( sizeOnDiskMB - 'sum(newRawMBytes)' ) / sizeOnDiskMB,4) 
| stats sum(newRawMBytes) as MBytes_Used, count(bucketId) as Bucket_Count by splunk_server,index,state,host 
| eval GBytes_Used=round(MBytes_Used/1024,2) 
| rename host as "Volume Name" 
| rename MBytes_Used as Space 
| eval "Copy Type"="Primary" 
| eval F4="Copy" 
| fields "Volume Name", Space, "Copy Type", F4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We have narrowed the issue down to &lt;CODE&gt;join splunk_server, bucketId&lt;/CODE&gt; as when we run &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true sum(everything.rawlen) as rawBytes from datamodel=storage_billing by splunk_server,index,everything.bucketId,host 
| rename everything.* as * 
| eval rawMBytes=rawBytes/1024/1024 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbinspect index=* 
| eval rawSizeMB=rawSize/1024/1024 
| fields splunk_server, bucketId, path, state, startEpoch, endEpoch, modTime, sizeOnDiskMB,rawSizeMB 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Separately, they work just fine. When we try to join then, that's when the search breaks. For reasons, this search is going back 7 years. Our current theory is that it is timing out before completion. &lt;/P&gt;

&lt;P&gt;Is there a way to streamline the search? Is &lt;CODE&gt;join&lt;/CODE&gt; the right way to do this? is there a faster, better way to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 14:59:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issues-with-Joining-Maybe-there-is-a-better-way/m-p/433485#M123744</guid>
      <dc:creator>cboillot</dc:creator>
      <dc:date>2019-01-30T14:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Joining: Maybe there is a better way?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Joining-Maybe-there-is-a-better-way/m-p/433486#M123745</link>
      <description>&lt;P&gt;There is almost always a better way than using &lt;CODE&gt;join&lt;/CODE&gt; (it should be avoided like the plague that it is).  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true sum(everything.rawlen) as rawBytes from datamodel=storage_billing by splunk_server,index,everything.bucketId,host 
| rename everything.* as * 
| eval rawMBytes=rawBytes/1024/1024 
| appendpipe
[ |dbinspect index=* 
| eval rawSizeMB=rawSize/1024/1024 
| fields splunk_server, bucketId, path, state, startEpoch, endEpoch, modTime, sizeOnDiskMB,rawSizeMB ] 
| stats values(*) AS * BY splunk_server, bucketId 
| search state=cold 
| eval compression=sizeOnDiskMB/rawSizeMB, newRawMBytes = rawMBytes * compression 
| eventstats sum(rawMBytes), sum(newRawMBytes) by splunk_server, bucketId 
| eval margin_of_error= round( ( sizeOnDiskMB - 'sum(newRawMBytes)' ) / sizeOnDiskMB,4) 
| stats sum(newRawMBytes) as MBytes_Used, count(bucketId) as Bucket_Count by splunk_server,index,state,host 
| eval GBytes_Used=round(MBytes_Used/1024,2) 
| rename host as "Volume Name" 
| rename MBytes_Used as Space 
| eval "Copy Type"="Primary" 
| eval F4="Copy" 
| fields "Volume Name", Space, "Copy Type", F4
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jan 2019 15:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issues-with-Joining-Maybe-there-is-a-better-way/m-p/433486#M123745</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-30T15:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Joining: Maybe there is a better way?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Joining-Maybe-there-is-a-better-way/m-p/433487#M123746</link>
      <description>&lt;P&gt;This didn't return anydata. I changed &lt;CODE&gt;search state=cold&lt;/CODE&gt; to &lt;CODE&gt;search state=*&lt;/CODE&gt; played around with removing lines to see where the issue or issues are at. I removed line13 ( &lt;CODE&gt;stats sum(newRawMBytes) as MBytes_Used, count(bucketId) as Bucket_Count by splunk_server,index,state,host&lt;/CODE&gt; ) and got some results, but nothing in the cold status. If i just run the &lt;CODE&gt;dbinspct&lt;/CODE&gt; sub, i do get results with all four states (how, warm, cold, thawed)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 16:19:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issues-with-Joining-Maybe-there-is-a-better-way/m-p/433487#M123746</guid>
      <dc:creator>cboillot</dc:creator>
      <dc:date>2019-01-30T16:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Joining: Maybe there is a better way?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Joining-Maybe-there-is-a-better-way/m-p/433488#M123747</link>
      <description>&lt;P&gt;You will have to play around a bit, I guess.  The main thing is that you use the &lt;CODE&gt;| appendpipe [ ... ] | stats values(*) AS * BY splunk_server bucketId&lt;/CODE&gt; instead of the &lt;CODE&gt;join&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 16:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issues-with-Joining-Maybe-there-is-a-better-way/m-p/433488#M123747</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-30T16:48:35Z</dc:date>
    </item>
  </channel>
</rss>

