<?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 do you get around the subsearch limitation when defining events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352065#M175161</link>
    <description>&lt;P&gt;BTW, using Splunk v6.2.6&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2017 05:34:31 GMT</pubDate>
    <dc:creator>splunk_svc</dc:creator>
    <dc:date>2017-03-13T05:34:31Z</dc:date>
    <item>
      <title>How do you get around the subsearch limitation when defining events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352064#M175160</link>
      <description>&lt;P&gt;Hi Splunkers.&lt;/P&gt;

&lt;P&gt;I am retrieving a field from JSON log file using rex, table and spath.&lt;BR /&gt;
Although this runs fine as a standard query, I'm not be able to turn this into an eventtype due to the restriction on subsearches when defining an event type's query.&lt;/P&gt;

&lt;P&gt;Here's my query:&lt;BR /&gt;
index=my_index "lane" |rex "^(?:[^ \n]* ){7}(?P.+)"|table my_data|spath input=my_data | fields lane&lt;/P&gt;

&lt;P&gt;I am trying to create an event type of "lane" from this but of course cannot due to the subquery limitation.&lt;BR /&gt;
I'm sure there is a way around this limitation but I've not been able to find it.&lt;BR /&gt;
Don't seem to have found anything similar post on here either.&lt;/P&gt;

&lt;P&gt;How does one get the output of this into an eventtype??&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:12:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352064#M175160</guid>
      <dc:creator>splunk_svc</dc:creator>
      <dc:date>2020-09-29T13:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get around the subsearch limitation when defining events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352065#M175161</link>
      <description>&lt;P&gt;BTW, using Splunk v6.2.6&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 05:34:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352065#M175161</guid>
      <dc:creator>splunk_svc</dc:creator>
      <dc:date>2017-03-13T05:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get around the subsearch limitation when defining events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352066#M175162</link>
      <description>&lt;P&gt;The rules for an eventtype actually says&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/Knowledge/Abouteventtypes"&gt;You cannot base an event type on a search that:&lt;/A&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Includes a pipe operator after a  simple search.&lt;/LI&gt;
&lt;LI&gt;Includes a subsearch.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;So you will need to remove ALL of the commands after the base search. First, the table and fields commands are adding nothing to your eventtype and can simply be deleted. The field extractions performed by the rex and spath commands should be coded into props.conf for the sourcetype. You will find some information about how to do this if you read the documentation for the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Spath"&gt;spath&lt;/A&gt; and rex commands. Here is another list of references for &lt;A href="http://docs.splunk.com/Splexicon:Fieldextraction"&gt;field extraction&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Finally, why do you need an eventtype? Perhaps a macro would serve you better, as it does not have these restrictions.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 06:17:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352066#M175162</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-03-13T06:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get around the subsearch limitation when defining events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352067#M175163</link>
      <description>&lt;P&gt;The problem is the pipes, not eventtypes.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 19:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352067#M175163</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-13T19:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get around the subsearch limitation when defining events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352068#M175164</link>
      <description>&lt;P&gt;The problem is the pipes, not eventtypes.  But let's back up.  Why do you think you need an eventtype?  What is your overall end goal?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 19:24:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-around-the-subsearch-limitation-when-defining/m-p/352068#M175164</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-13T19:24:08Z</dc:date>
    </item>
  </channel>
</rss>

