<?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: Merging two splunk queries together in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-merge-two-splunk-queries-together/m-p/622564#M107165</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251355"&gt;@Taibat02230232&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you're sure that one of the searches has less than 50,000 results, you can use append:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="aws-cloudtrail" eventName="AssumeRoleWithSAML" 
| spath "requestParameters.roleArn" 
| search "*super*admin*"
| rex field=responseElements.subject "(?&amp;lt;Email&amp;gt;[a-zA-Z0-9]{1,8}@digitlogs.com$)"
| search Email=*
| table Email,"recipientAccountId"
| dedup Email, "recipientAccountId"
| append search
   index="okta" displayMessage="Authenticate user with AD agent"
   | rename target{}.alternateId as email
   | eval my_ponies=mvindex(email, -3, -2)
   | eval Email=mvindex(email, 0)
   | eval email=mvindex(email, 1)
   | table Email email
   ]
| stats 
   values(recipientAccountId) AS recipientAccountId 
   values(email) AS email 
   BY Email&lt;/LI-CODE&gt;&lt;P&gt;otherwise you have to use a more complex search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2022 07:46:01 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-11-30T07:46:01Z</dc:date>
    <item>
      <title>How can I merge two splunk queries together?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-merge-two-splunk-queries-together/m-p/622523#M107160</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have two Splunk queries 1 and 2 below, and both have one common email , i want the searched emails generated from the result which are email variable to be able to send an alert notification base on the search result generated email.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I need the common value to have the field with matching values in both queries which is the  email , then be able to send an email alert notification&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Query-1&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="aws-cloudtrail" eventName="AssumeRoleWithSAML" |fields *
| spath "requestParameters.roleArn" |search "*super*admin*"
| rex field=responseElements.subject "(?&amp;lt;Email&amp;gt;[a-zA-Z0-9]{1,8}@digitlogs.com$)"
| search Email=*
| table Email,"recipientAccountId"
| dedup Email, "recipientAccountId"&lt;/LI-CODE&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Query-2&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="okta" displayMessage="Authenticate user with AD agent"
| rename target{}.alternateId as email
| eval my_ponies=mvindex(email, -3, -2)
| eval Email=mvindex(email, 0)
| eval email=mvindex(email, 1)
| table Email email&lt;/LI-CODE&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Here are the two of them, please any input will help&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 18:01:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-merge-two-splunk-queries-together/m-p/622523#M107160</guid>
      <dc:creator>Taibat02230232</dc:creator>
      <dc:date>2022-11-30T18:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two splunk queries together</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-merge-two-splunk-queries-together/m-p/622564#M107165</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251355"&gt;@Taibat02230232&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you're sure that one of the searches has less than 50,000 results, you can use append:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="aws-cloudtrail" eventName="AssumeRoleWithSAML" 
| spath "requestParameters.roleArn" 
| search "*super*admin*"
| rex field=responseElements.subject "(?&amp;lt;Email&amp;gt;[a-zA-Z0-9]{1,8}@digitlogs.com$)"
| search Email=*
| table Email,"recipientAccountId"
| dedup Email, "recipientAccountId"
| append search
   index="okta" displayMessage="Authenticate user with AD agent"
   | rename target{}.alternateId as email
   | eval my_ponies=mvindex(email, -3, -2)
   | eval Email=mvindex(email, 0)
   | eval email=mvindex(email, 1)
   | table Email email
   ]
| stats 
   values(recipientAccountId) AS recipientAccountId 
   values(email) AS email 
   BY Email&lt;/LI-CODE&gt;&lt;P&gt;otherwise you have to use a more complex search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 07:46:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-merge-two-splunk-queries-together/m-p/622564#M107165</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-30T07:46:01Z</dc:date>
    </item>
  </channel>
</rss>

