<?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: Alternative to Join Subsearch to avoid 50k results limit in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Alternative-to-Join-Subsearch-to-avoid-50k-results-limit/m-p/487905#M136318</link>
    <description>&lt;P&gt;When I tried this, I got the following error:&lt;/P&gt;

&lt;P&gt;Error in 'stats' command: The output field 'event_date' cannot have the same name as a group-by field.&lt;/P&gt;

&lt;P&gt;My goal is to find the count of report_num that have the same equip_serial_number and had a reported_date on the same day as the trigger_time.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:18:46 GMT</pubDate>
    <dc:creator>mjhermansky</dc:creator>
    <dc:date>2020-09-30T02:18:46Z</dc:date>
    <item>
      <title>Alternative to Join Subsearch to avoid 50k results limit</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alternative-to-Join-Subsearch-to-avoid-50k-results-limit/m-p/487903#M136316</link>
      <description>&lt;P&gt;I can use the following search to get 1 day worth of data, but anything longer causes the subsearch to hit its limit.  Please Help&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=x_default sourcetype="x.alarm.y.norm" device_type=term   description="EQUIP is Inactive" OR description="EQUIP LOS" OR description="EQUIP is inactive" 
| eval event_time= strptime(trigger_time, "%Y-%m-%d %H:%M:%S") 
   | convert timeformat="%Y-%m-%d" ctime(event_time) AS event_date 
| join type=inner equip_serial_number event_date [ search index=sperf_default sourcetype=common.ticket.opened.norm report_type=TR
| eval report_time= strptime(reported_date, "%m/%d/%Y %H:%M:%S") 
   | convert timeformat="%Y-%m-%d" ctime(report_time) AS event_date]
| chart dc(equip_serial_number) dc(report_num) BY event_date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you in advance for your help&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 17:07:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alternative-to-Join-Subsearch-to-avoid-50k-results-limit/m-p/487903#M136316</guid>
      <dc:creator>mjhermansky</dc:creator>
      <dc:date>2019-09-19T17:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to Join Subsearch to avoid 50k results limit</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alternative-to-Join-Subsearch-to-avoid-50k-results-limit/m-p/487904#M136317</link>
      <description>&lt;P&gt;Hi mjhermansky,&lt;BR /&gt;
the logic is to create a search with both the searches with OT clause, to use the stats command using BY option for the key fields, then you pass as values the fields you need, &lt;BR /&gt;
in other words, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=x_default sourcetype="x.alarm.y.norm" device_type=term   description="EQUIP is Inactive" OR description="EQUIP LOS" OR description="EQUIP is inactive") OR (index=sperf_default sourcetype=common.ticket.opened.norm report_type=TR)
 | eval event_time= strptime(trigger_time, "%Y-%m-%d %H:%M:%S") 
    | convert timeformat="%Y-%m-%d" ctime(event_time) AS event_date 
 | eval report_time= strptime(reported_date, "%m/%d/%Y %H:%M:%S") 
    | convert timeformat="%Y-%m-%d" ctime(report_time) AS event_date]
| stats values(event_time) AS event_time values(event_date ) AS event_date values(report_time) AS report_time BY equip_serial_number event_date
 | chart dc(equip_serial_number) dc(report_num) BY event_date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Obviously, you have to check if in your stats command you have all fields you need (in this case you can add another values option) and to check the values you have in your stats options: if you have more values and you need only one you can use a different option like earliest, latest or max ...&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 07:00:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alternative-to-Join-Subsearch-to-avoid-50k-results-limit/m-p/487904#M136317</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-09-20T07:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to Join Subsearch to avoid 50k results limit</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alternative-to-Join-Subsearch-to-avoid-50k-results-limit/m-p/487905#M136318</link>
      <description>&lt;P&gt;When I tried this, I got the following error:&lt;/P&gt;

&lt;P&gt;Error in 'stats' command: The output field 'event_date' cannot have the same name as a group-by field.&lt;/P&gt;

&lt;P&gt;My goal is to find the count of report_num that have the same equip_serial_number and had a reported_date on the same day as the trigger_time.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:18:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alternative-to-Join-Subsearch-to-avoid-50k-results-limit/m-p/487905#M136318</guid>
      <dc:creator>mjhermansky</dc:creator>
      <dc:date>2020-09-30T02:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to Join Subsearch to avoid 50k results limit</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alternative-to-Join-Subsearch-to-avoid-50k-results-limit/m-p/487906#M136319</link>
      <description>&lt;P&gt;Sorry, my repetition error&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(event_time) AS event_time values(report_time) AS report_time BY equip_serial_number event_date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 13:40:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alternative-to-Join-Subsearch-to-avoid-50k-results-limit/m-p/487906#M136319</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-09-20T13:40:23Z</dc:date>
    </item>
  </channel>
</rss>

