<?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: Combine 2 searches into table..one is a stats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combine-2-searches-into-table-one-is-a-stats/m-p/119010#M31875</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=collaboration sourcetype="mail-2" UBL 
| stats count by simta_ublauthuser simta_ublstatus
| rename simta_ublauthuser as user
| join type=inner max=0 user [ search index=collaboration sourcetype="mail-2" Auth 
    | dedup simta_client_ip 
    | eval user = simta_smtp_authuser
    | fields user simta_client_ip ]
| geoip simta_client_ip 
| sort user simta_client_ip 
| table user simta_client_ip simta_client_ip_country_name simta_client_ip_city simta_ublstatus count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Oct 2013 00:36:26 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2013-10-29T00:36:26Z</dc:date>
    <item>
      <title>Combine 2 searches into table..one is a stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-2-searches-into-table-one-is-a-stats/m-p/119009#M31874</link>
      <description>&lt;P&gt;Hello &lt;BR /&gt;
I have the following searches below.  The simta_smtp_authuser is the same username as the simta_ublauthuser of the second search.&lt;BR /&gt;&lt;BR /&gt;
What Im trying to do is include the stat results from search 2 into the table of search 1 and rename the simta_ublauthuser to simta_smtp_authuser so that sorting will group everything together. &lt;/P&gt;

&lt;P&gt;index=collaboration sourcetype="mail-2" Auth  [search index=collaboration sourcetype="mail-2" | fields simta_ublauthuser | dedup simta_ublauthuser | return 500 $simta_ublauthuser] | fields simta_client_ip simta_smtp_authuser | dedup simta_client_ip | geoip simta_client_ip | sort simta_smtp_authuser simta_client_ip | table simta_smtp_authuser simta_client_ip simta_client_ip_country_name simta_client_ip_city&lt;/P&gt;

&lt;P&gt;thanks a bunch everyone.  hope that makes sense.&lt;/P&gt;

&lt;P&gt;index=collaboration sourcetype="mail-2" UBL | stats count by simta_ublauthuser simta_ublstatus &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:06:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-2-searches-into-table-one-is-a-stats/m-p/119009#M31874</guid>
      <dc:creator>brywilk_umich</dc:creator>
      <dc:date>2020-09-28T15:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Combine 2 searches into table..one is a stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-2-searches-into-table-one-is-a-stats/m-p/119010#M31875</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=collaboration sourcetype="mail-2" UBL 
| stats count by simta_ublauthuser simta_ublstatus
| rename simta_ublauthuser as user
| join type=inner max=0 user [ search index=collaboration sourcetype="mail-2" Auth 
    | dedup simta_client_ip 
    | eval user = simta_smtp_authuser
    | fields user simta_client_ip ]
| geoip simta_client_ip 
| sort user simta_client_ip 
| table user simta_client_ip simta_client_ip_country_name simta_client_ip_city simta_ublstatus count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Oct 2013 00:36:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-2-searches-into-table-one-is-a-stats/m-p/119010#M31875</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-10-29T00:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Combine 2 searches into table..one is a stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-2-searches-into-table-one-is-a-stats/m-p/119011#M31876</link>
      <description>&lt;P&gt;thanks.  Its close its just seems to be missing the different simta_client_ip's.  looks like it grabs the first one and seems to stop.&lt;/P&gt;

&lt;P&gt;The simta_client_ip will usually be a couple (depending on if the account is used by a spammer from multiple locations).  The simta_ublstatus will be the same for the user&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:07:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-2-searches-into-table-one-is-a-stats/m-p/119011#M31876</guid>
      <dc:creator>brywilk_umich</dc:creator>
      <dc:date>2020-09-28T15:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Combine 2 searches into table..one is a stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-2-searches-into-table-one-is-a-stats/m-p/119012#M31877</link>
      <description>&lt;P&gt;I updated the answer and added &lt;CODE&gt;max=0&lt;/CODE&gt; to the &lt;CODE&gt;join&lt;/CODE&gt; command. This should fix the problem, I hope.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 17:20:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-2-searches-into-table-one-is-a-stats/m-p/119012#M31877</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-10-29T17:20:20Z</dc:date>
    </item>
  </channel>
</rss>

