<?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 combine two queries into one without using eventtypes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154237#M43364</link>
    <description>&lt;P&gt;I can understand your frustration, I have got Splunk- slapped many times. Try the updated options which definitely should work (provided your individual queries were working).&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2014 17:08:26 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-02-18T17:08:26Z</dc:date>
    <item>
      <title>How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154229#M43356</link>
      <description>&lt;P&gt;I have the two separate queries that I could like to combine into on query without using event types.  How can I do this as one query?&lt;/P&gt;

&lt;P&gt;query 1:&lt;BR /&gt;
source=....."labelData= " | stats count&lt;/P&gt;

&lt;P&gt;query 2:&lt;BR /&gt;
source=..... lableData!="" | stats count&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;ACTUAL LOGS:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;// NO MATCH  [2014-02-18 10:21:53,302](org.mysession.Session-/xxx)([8fae1ec7-39bf-4c0b-97ba-144a55d1510e INFO  - MyClass                      - Parsed info: labelData= labelDataValue= matchedLocale= textLength=2636 

// MATCH [2014-02-18 10:24:52,302](org.mysession.Session-/xxx)([8fae1ec7-39bf-4c0b-97ba-144a55d1510e INFO  - MyClass                      - Parsed info: labelData=EN_US labelDataValue=1 matchedLocale= textLength=2636
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Feb 2014 23:03:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154229#M43356</guid>
      <dc:creator>jaj</dc:creator>
      <dc:date>2014-02-17T23:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154230#M43357</link>
      <description>&lt;P&gt;Try this (assuming labelData is an extracted field for you and both query uses same source)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=yoursource  | stats count(eval(isnull(labelData))) as CountBlank, count(eval(isnotnull(labelData))) as CountValues
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR (in case upper one doesn't work)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=yoursource  | stats count(eval(labelData="")) as CountBlank, count(eval(labelData!="") as CountValues
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H2&gt;Update: Another Option&lt;/H2&gt;

&lt;PRE&gt;&lt;CODE&gt;source=yoursource   | stats count(eval(len(labelData)=0)) as CountBlank, count(eval(len(labelData)!=0)) as CountValues
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H2&gt;2nd Update:&lt;/H2&gt;

&lt;P&gt;This should work (work around)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=yoursource "labelData= " | stats count as CountBlank | appendcols [search source=yoursource lableData!="" | stats count as CountValues]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Feb 2014 14:58:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154230#M43357</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-18T14:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154231#M43358</link>
      <description>&lt;P&gt;cool.  thanks for the reply.  i was able to get second part of your query to work.  however, the first part doesn't work.  please see my updates on how things are getting logged.  for some reason I can't match misses like labelData="".  instead I have to match "labelData= " but that was only working for my original query.  if I put that into the first part of your query it wont' work for some reason&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 15:43:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154231#M43358</guid>
      <dc:creator>jaj</dc:creator>
      <dc:date>2014-02-18T15:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154232#M43359</link>
      <description>&lt;P&gt;Did you try both the options that I provided? especially the first one?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154232#M43359</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-18T16:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154233#M43360</link>
      <description>&lt;P&gt;Since all records will either have labelData="" or labelDate!="", so one work around will be:&lt;BR /&gt;
source=yoursource  | stats count as Total count(eval(isnotnull(labelData))) as CountValues | eval CountBlank=Total-CountValues | fields - Total&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:19:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154233#M43360</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-18T16:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154234#M43361</link>
      <description>&lt;P&gt;the first query isn't working either.  the section count(eval(isnull(matchedParsePatterns))) &lt;/P&gt;

&lt;P&gt;brings back all instances (matches and n0 matches) i.e. labelData= as well as labelData=somevalue&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:24:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154234#M43361</guid>
      <dc:creator>jaj</dc:creator>
      <dc:date>2014-02-18T16:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154235#M43362</link>
      <description>&lt;P&gt;It seems a blank "" is getting assigned instead on NULL which I was thinking. Try the option 3 I provided, should work based on observations your provided.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154235#M43362</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-18T16:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154236#M43363</link>
      <description>&lt;P&gt;updated logs...i can't figure out this one for the life of me.  i tried your update .  the second part works fine.  the blank ones doesn't.  what is the deal with splunk and having issues matching  "log msg labelData= " as opposed to "log msg labelData=EN_US"?  i can' figure out why splunk messes this up?  i have triple checked everything on my side.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154236#M43363</guid>
      <dc:creator>jaj</dc:creator>
      <dc:date>2014-02-18T16:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154237#M43364</link>
      <description>&lt;P&gt;I can understand your frustration, I have got Splunk- slapped many times. Try the updated options which definitely should work (provided your individual queries were working).&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 17:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154237#M43364</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-18T17:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154238#M43365</link>
      <description>&lt;P&gt;That last workaround worked.  Not sure why the others aren't working.  It's bizarre.  Thanks for not giving up on me.  &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;  Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 17:28:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154238#M43365</guid>
      <dc:creator>jaj</dc:creator>
      <dc:date>2014-02-18T17:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two queries into one without using eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154239#M43366</link>
      <description>&lt;P&gt;one last ask, how can I get them as separate rows so that I can put them in a pie chart for display?  i tried append but no go&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 17:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-queries-into-one-without-using-eventtypes/m-p/154239#M43366</guid>
      <dc:creator>jaj</dc:creator>
      <dc:date>2014-02-18T17:35:04Z</dc:date>
    </item>
  </channel>
</rss>

