<?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 to create a base search that retains multiple regex fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307738#M92330</link>
    <description>&lt;P&gt;right. I sent @cpride_splunk my use case for it after conf last year. mine was to basically to create summation rows based on different fields. for instance:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multireport
    [ stats count by PluginName]
    [ stats count by ErrorType PluginName]
    [ stats count by ExceptionName ErrorType PluginName]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;would add summary row counts for each by statement. not necessarily for this data, but something similar to how i used it.&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2017 16:06:44 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2017-05-23T16:06:44Z</dc:date>
    <item>
      <title>How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307726#M92318</link>
      <description>&lt;P&gt;I have a dashboard that is built from 3 different searches.  They all come from the same data so I would like to turn them into a base search for the page.   However, each one of them has a different regex to pull out a field and I can't figure out how to combine them without losing those fields. &lt;/P&gt;

&lt;P&gt;These are my current searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo source=bar host=PRD* CIWEB AND Error 
 | rex field=_raw "CIWEB\.(?&amp;lt;PluginName&amp;gt;.*?Plugin)"              
 | timechart span=1h count(PluginName) by PluginName

index=foo source=bar host=PRD* CIWEB AND Error 
 | rex field=_raw "\sE\_(?&amp;lt;ErrorType&amp;gt;.*?):"  
 | timechart span=1h count(ErrorType) by ErrorType

    index=foo source=bar host=PRD* CIWEB AND Error 
 | rex field=_raw "\.(?&amp;lt;ExceptionName&amp;gt;\w*?Exception)" 
 | timechart span=1h count(ExceptionName) by ExceptionName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 May 2017 20:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307726#M92318</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2017-05-22T20:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307727#M92319</link>
      <description>&lt;P&gt;you're base search could just be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo source=bar host=PRD* CIWEB AND Error 
  | rex field=_raw "CIWEB\.(?&amp;lt;PluginName&amp;gt;.*?Plugin)"       
 | rex field=_raw "\sE\_(?&amp;lt;ErrorType&amp;gt;.*?):
| rex field=_raw "\.(?&amp;lt;ExceptionName&amp;gt;\w*?Exception)" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with each panel having a query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | timechart span=1h count(PluginName) by PluginName

 | timechart span=1h count(ErrorType) by ErrorType

| timechart span=1h count(ExceptionName) by ExceptionName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 May 2017 20:07:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307727#M92319</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-05-22T20:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307728#M92320</link>
      <description>&lt;P&gt;I got that far but I thought a base search had to have a stats function?  As soon as I add that it breaks. &lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 20:09:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307728#M92320</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2017-05-22T20:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307729#M92321</link>
      <description>&lt;P&gt;try adding &lt;CODE&gt;|table *&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 20:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307729#M92321</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-05-22T20:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307730#M92322</link>
      <description>&lt;P&gt;Do all events have those fields that you're extracting?&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 22:02:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307730#M92322</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-22T22:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307731#M92323</link>
      <description>&lt;P&gt;Or better (keep only what you need)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table _time PluginName ErrorType ExceptionName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 May 2017 22:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307731#M92323</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-22T22:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307732#M92324</link>
      <description>&lt;P&gt;Your &lt;CODE&gt;base search&lt;/CODE&gt; is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo source=bar host=PRD* CIWEB AND Error 
| rex "CIWEB\.(?&amp;lt;PluginName&amp;gt;.*?Plugin)"              
| rex "\sE\_(?&amp;lt;ErrorType&amp;gt;.*?):"  
| rex "\.(?&amp;lt;ExceptionName&amp;gt;\w*?Exception)" 
| multireport
   [ timechart span=1h count(PluginName)    BY PluginName    | untable _time PluginName    count]
   [ timechart span=1h count(ErrorType)     BY ErrorType     | untable _time Errortype     count]
   [ timechart span=1h count(ExceptionName) BY ExceptionName | untable _time ExceptionName count]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you make each &lt;CODE&gt;post-process&lt;/CODE&gt; one of these:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;fields _time PluginName count | xyseries _time PluginName count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;fields _time Errortype count | xyseries _time Errortype count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;fields _time ExceptionName count | xyseries _time ExceptionName count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 May 2017 23:09:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307732#M92324</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-22T23:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307733#M92325</link>
      <description>&lt;P&gt;You are correct; see my answer.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 00:18:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307733#M92325</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-23T00:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307734#M92326</link>
      <description>&lt;P&gt;This worked perfectly!  Thank you woodcock!&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 15:21:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307734#M92326</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2017-05-23T15:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307735#M92327</link>
      <description>&lt;P&gt;I didn't knew of multireport command, don't see in the documentation as well. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 15:39:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307735#M92327</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-23T15:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307736#M92328</link>
      <description>&lt;P&gt;multireport isn't in documentation. I've brought it up to the documentation team and there is a ticket with them and the engineers. it isn't fully tested out on every aspect of how it works yet.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 15:47:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307736#M92328</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-05-23T15:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307737#M92329</link>
      <description>&lt;P&gt;Based on my brief testing, it runs all those timecharts (or any other aggregation command that you put in) one by one and appends the results together, making it ideal for base searches.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 15:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307737#M92329</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-23T15:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307738#M92330</link>
      <description>&lt;P&gt;right. I sent @cpride_splunk my use case for it after conf last year. mine was to basically to create summation rows based on different fields. for instance:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multireport
    [ stats count by PluginName]
    [ stats count by ErrorType PluginName]
    [ stats count by ExceptionName ErrorType PluginName]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;would add summary row counts for each by statement. not necessarily for this data, but something similar to how i used it.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 16:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/307738#M92330</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-05-23T16:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a base search that retains multiple regex fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/681662#M232936</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Looking into the solution I am facing an issue when I do base-search. When I use the regex in SPL code and when it gets converted to xml. My code is not working. If I change my xml code I get unvalidated tag . Is there a way to get it working in base search&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;IN SPL code:&lt;/U&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex field="log.mess" ".*\"Category\":\"(?&amp;lt;Category&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;U&gt;&lt;SPAN class=""&gt;In xml:&lt;/SPAN&gt;&lt;/U&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex field="log.mess" ".*\"Category\":\"(?&amp;amp;amp;lt;Category&amp;amp;amp;gt;[^\"]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Mar 2024 14:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-base-search-that-retains-multiple-regex-fields/m-p/681662#M232936</guid>
      <dc:creator>gemrose</dc:creator>
      <dc:date>2024-03-22T14:03:22Z</dc:date>
    </item>
  </channel>
</rss>

