<?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: Two searches combined including transaction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Two-searches-combined-including-transaction/m-p/49023#M11733</link>
    <description>&lt;P&gt;Sorry for the late reply, this does seem to work for some months and not others, I'll investigate a bit and see what the issue is. Thanks for the response.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2013 16:57:41 GMT</pubDate>
    <dc:creator>DanielFordWA</dc:creator>
    <dc:date>2013-10-30T16:57:41Z</dc:date>
    <item>
      <title>Two searches combined including transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-searches-combined-including-transaction/m-p/49021#M11731</link>
      <description>&lt;P&gt;The below gives me the correct number of hits per external user&lt;/P&gt;

&lt;P&gt;sourcetype="iis-2" | extract auto=true | search CORE_employee="F*" | stats count(cs_uri_stem) AS Hits by cs_username date | fields date cs_username Hits&lt;/P&gt;

&lt;P&gt;The second search below gives me the roughly correct number of visits per user, I need to refine it slightly.&lt;/P&gt;

&lt;P&gt;sourcetype="iis-2" | extract auto=true | search CORE_employee="F*" | transaction cs_username maxspan=30m | stats count AS Visits by cs_username date | fields date cs_username Visits&lt;/P&gt;

&lt;P&gt;How would I combine the two into one search that would result in a table &lt;/P&gt;

&lt;P&gt;date, cs_username, Hits, Visits&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-searches-combined-including-transaction/m-p/49021#M11731</guid>
      <dc:creator>DanielFordWA</dc:creator>
      <dc:date>2020-09-28T13:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Two searches combined including transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-searches-combined-including-transaction/m-p/49022#M11732</link>
      <description>&lt;P&gt;I reread your question and updated my search to address request more accurately.  One way would be the &lt;STRONG&gt;append&lt;/STRONG&gt; command, with some &lt;STRONG&gt;eval&lt;/STRONG&gt; and possibly &lt;STRONG&gt;stats&lt;/STRONG&gt; usage as well.  The key is making each search have the same columns.  How about something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="iis-2" 
    | extract auto=true 
    | search CORE_employee="F*" 
    | eval Visits=0 
    | stats count(cs_uri_stem) AS "Hits", sum(Visits) as "Visits" by cs_username date 
    | fields date cs_username Hits Visits 
| append [search sourcetype="iis-2" 
    | extract auto=true 
    | search CORE_employee="F*" 
    | transaction cs_username maxspan=30m 
    | eval Hits=0 
    | stats count AS "Visits", sum(Hits) as "Hits" by cs_username date 
    | fields date cs_username Hits Visits ] 
| stats sum(Hits) as "Hits", sum(Visits) as "Visits" by date, cs_username 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does this do what you need?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2013 15:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-searches-combined-including-transaction/m-p/49022#M11732</guid>
      <dc:creator>wpreston</dc:creator>
      <dc:date>2013-05-29T15:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Two searches combined including transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Two-searches-combined-including-transaction/m-p/49023#M11733</link>
      <description>&lt;P&gt;Sorry for the late reply, this does seem to work for some months and not others, I'll investigate a bit and see what the issue is. Thanks for the response.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2013 16:57:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Two-searches-combined-including-transaction/m-p/49023#M11733</guid>
      <dc:creator>DanielFordWA</dc:creator>
      <dc:date>2013-10-30T16:57:41Z</dc:date>
    </item>
  </channel>
</rss>

