<?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: merge two searches without available fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88405#M22612</link>
    <description>&lt;P&gt;Error='The arguments to the 'searchmatch' function are invalid.&lt;BR /&gt;
Another idea?&lt;/P&gt;</description>
    <pubDate>Fri, 12 Oct 2012 12:51:17 GMT</pubDate>
    <dc:creator>rechteklebe</dc:creator>
    <dc:date>2012-10-12T12:51:17Z</dc:date>
    <item>
      <title>merge two searches without available fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88403#M22610</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;i have two searches where the text expressions are different(without fields) (Login Successful and Unsuccessful). I'd like to have the amount of user divided by country&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;index=123 sourcetype=123 country=* "Login successful" | stats count by country&lt;/LI&gt;
&lt;LI&gt;index=123 sourcetype=123 country=* "Login unsuccessful" | stats count by country&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Now i would like to merge this two searches in one chart divided by the country&lt;BR /&gt;
The table should look like: &lt;/P&gt;

&lt;P&gt;Columns are "Country" "Login Successful" "Login unsuccessful" &lt;BR /&gt;&lt;BR /&gt;
1st row for example: DE 20 5&lt;/P&gt;

&lt;P&gt;I tried to use following search:&lt;/P&gt;

&lt;P&gt;index="123" sourcetype="123" "Login successful" OR "Login unsuccessful" &lt;BR /&gt;
|eval Successful_Logins=searchmatch("Login successful")&lt;BR /&gt;
|eval Unsuccessful_Logins=searchmatch("Login unsuccessful")&lt;BR /&gt;
|stats Successful_Logins Unsuccessful Logins by country&lt;/P&gt;

&lt;P&gt;How i can merge two searches without fields (no fields are used for "Login (un)successful")?&lt;/P&gt;

&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88403#M22610</guid>
      <dc:creator>rechteklebe</dc:creator>
      <dc:date>2020-09-28T12:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: merge two searches without available fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88404#M22611</link>
      <description>&lt;P&gt;You can use searchmatch and eval in your stats expression.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=123 sourcetype=123 "Login successful" OR "Login unsuccessful" | stats count(eval(searchmatch("Login successful"))) as Successful_Logins count(eval(searchmatch("Login unsuccessful"))) as Unsuccessful_Logins by country
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Oct 2012 12:43:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88404#M22611</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2012-10-12T12:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: merge two searches without available fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88405#M22612</link>
      <description>&lt;P&gt;Error='The arguments to the 'searchmatch' function are invalid.&lt;BR /&gt;
Another idea?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 12:51:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88405#M22612</guid>
      <dc:creator>rechteklebe</dc:creator>
      <dc:date>2012-10-12T12:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: merge two searches without available fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88406#M22613</link>
      <description>&lt;P&gt;This exact search worked for me against Windows Security Log Data&lt;BR /&gt;
&lt;CODE&gt;*| stats count(eval(searchmatch("Success Audit"))) as Successful_Logins count(eval(searchmatch("Fail* Audit"))) as Unsuccessful_Logins&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 12:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88406#M22613</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2012-10-12T12:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: merge two searches without available fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88407#M22614</link>
      <description>&lt;P&gt;Can you post the exact search you are running? What version of Splunk?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 12:55:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88407#M22614</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2012-10-12T12:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: merge two searches without available fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88408#M22615</link>
      <description>&lt;P&gt;sorry it was my fault. now your search is working fine! Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 12:59:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-two-searches-without-available-fields/m-p/88408#M22615</guid>
      <dc:creator>rechteklebe</dc:creator>
      <dc:date>2012-10-12T12:59:47Z</dc:date>
    </item>
  </channel>
</rss>

