<?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: combining 2 searches - with dynamic urls into 1 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/combining-2-searches-with-dynamic-urls-into-1/m-p/748572#M242010</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253204"&gt;@super_edition&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you could try something like this (see my approach and adapt it to your data):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"  kubernetes_namespace="my_ns"  kubernetes_cluster!="bad_cluster" kubernetes_deployment_name="frontend_service" msg="RESPONSE" ("/my_service/user-registration" OR "/my_service/profile-retrieval")
| eval url=if(searchmatch("/my_service/profile-retrieval"),"/my_service/profile-retrieval","/my_service/user-registration")
| stats count as hits avg(responseTime) as avgResponse perc90(responseTime) as nintyPerc by url method kubernetes_cluster
| eval avgResponse=round(avgResponse,2) 
| eval nintyPerc=round(nintyPerc,2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jun 2025 08:27:41 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2025-06-24T08:27:41Z</dc:date>
    <item>
      <title>combining 2 searches - with dynamic urls into 1</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combining-2-searches-with-dynamic-urls-into-1/m-p/748569#M242008</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;I have 2 splunk search queries&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;query-1&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"  kubernetes_namespace="my_ns"  kubernetes_cluster!="bad_cluster" kubernetes_deployment_name="frontend_service" msg="RESPONSE" "/my_service/user-registration"
| dedup req_id
| stats count as hits avg(responseTime) as avgResponse perc90(responseTime) as nintyPerc by url method kubernetes_cluster
| eval avgResponse=round(avgResponse,2) 
| eval nintyPerc=round(nintyPerc,2)&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;output&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="98.10606060606061%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;url&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;method&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;kubernetes_cluster&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;hits&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;avgResponse&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;nintyPerc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;/my_service/user-registration&lt;/TD&gt;&lt;TD&gt;POST&lt;/TD&gt;&lt;TD&gt;LON&lt;/TD&gt;&lt;TD&gt;11254&lt;/TD&gt;&lt;TD&gt;112&lt;/TD&gt;&lt;TD&gt;535&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;query-2&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"  kubernetes_namespace="my_ns"  kubernetes_cluster!="bad_cluster" kubernetes_deployment_name="frontend_service" msg="RESPONSE" "/my_service/profile-retrieval"
| eval normalized_url="/my_service/profile-retrieval"
| stats count as hits avg(responseTime) as avgResponse perc90(responseTime) as nintyPerc by normalized_url method kubernetes_cluster
| eval avgResponse=round(avgResponse,2) 
| eval nintyPerc=round(nintyPerc,2)&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;output&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;url&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;method&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;kubernetes_cluster&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;hits&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;avgResponse&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;nintyPerc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;/my_service/profile-retrieval&lt;/TD&gt;&lt;TD&gt;GET&lt;/TD&gt;&lt;TD&gt;LON&lt;/TD&gt;&lt;TD&gt;55477&lt;/TD&gt;&lt;TD&gt;698&lt;/TD&gt;&lt;TD&gt;3423&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;query-2&lt;/STRONG&gt; returns multiple urls like below but belongs to same endpoint:&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;/my_service/profile-retrieval/324524352&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;/my_service/profile-retrieval/453453?displayOptions=ADDRESS%2CCONTACT&amp;amp;programCode=SKW&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;/my_service/profile-retrieval/?displayOptions=PREFERENCES&amp;amp;programCode=SKW&amp;amp;ssfMembershipId=00408521260&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hence I used eval function to normalized them&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;eval normalized_url="/my_service/profile-retrieval"&lt;/LI-CODE&gt;&lt;P&gt;How do I combine both queries to return as simplified output&lt;/P&gt;&lt;TABLE border="1" width="777.0000000000001px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="129.50000000000003px" height="25px"&gt;url&lt;/TD&gt;&lt;TD width="129.50000000000003px" height="25px"&gt;method&lt;/TD&gt;&lt;TD width="129.50000000000003px" height="25px"&gt;kubernetes_cluster&lt;/TD&gt;&lt;TD width="129.50000000000003px" height="25px"&gt;hits&lt;/TD&gt;&lt;TD width="129.50000000000003px" height="25px"&gt;avgResponse&lt;/TD&gt;&lt;TD width="129.50000000000003px" height="25px"&gt;nintyPerc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="129.50000000000003px"&gt;/my_service/user-registration&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;POST&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;LON&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;11254&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;112&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;535&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="129.50000000000003px"&gt;/my_service/profile-retrieval&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;GET&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;LON&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;55477&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;698&lt;/TD&gt;&lt;TD width="129.50000000000003px"&gt;3423&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Highly appreciate your help!!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 08:12:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combining-2-searches-with-dynamic-urls-into-1/m-p/748569#M242008</guid>
      <dc:creator>super_edition</dc:creator>
      <dc:date>2025-06-24T08:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: combining 2 searches - with dynamic urls into 1</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combining-2-searches-with-dynamic-urls-into-1/m-p/748571#M242009</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253204"&gt;@super_edition&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can either use append or eval match condition to combine both for your scenario&lt;/P&gt;&lt;P&gt;using append&lt;/P&gt;&lt;P&gt;(&lt;BR /&gt;index="my_index" kubernetes_namespace="my_ns" kubernetes_cluster!="bad_cluster" kubernetes_deployment_name="frontend_service" msg="RESPONSE" "/my_service/user-registration"&lt;BR /&gt;| dedup req_id&lt;BR /&gt;| stats count as hits avg(responseTime) as avgResponse perc90(responseTime) as nintyPerc by url method kubernetes_cluster&lt;BR /&gt;| eval avgResponse=round(avgResponse,2)&lt;BR /&gt;| eval nintyPerc=round(nintyPerc,2)&lt;BR /&gt;)&lt;BR /&gt;| append [&lt;BR /&gt;search index="my_index" kubernetes_namespace="my_ns" kubernetes_cluster!="bad_cluster" kubernetes_deployment_name="frontend_service" msg="RESPONSE" "/my_service/profile-retrieval"&lt;BR /&gt;| eval url="/my_service/profile-retrieval"&lt;BR /&gt;| stats count as hits avg(responseTime) as avgResponse perc90(responseTime) as nintyPerc by url method kubernetes_cluster&lt;BR /&gt;| eval avgResponse=round(avgResponse,2)&lt;BR /&gt;| eval nintyPerc=round(nintyPerc,2)&lt;BR /&gt;]&lt;BR /&gt;| table url method kubernetes_cluster hits avgResponse nintyPerc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;combined&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;index="my_index" kubernetes_namespace="my_ns" kubernetes_cluster!="bad_cluster" kubernetes_deployment_name="frontend_service" msg="RESPONSE" ("/my_service/user-registration" OR "/my_service/profile-retrieval")&lt;BR /&gt;| eval url=if(match(url, "^/my_service/user-registration"), "/my_service/user-registration",&lt;BR /&gt;if(match(url, "^/my_service/profile-retrieval"), "/my_service/profile-retrieval", url))&lt;BR /&gt;| dedup req_id&lt;BR /&gt;| stats count as hits avg(responseTime) as avgResponse perc90(responseTime) as nintyPerc by url method kubernetes_cluster&lt;BR /&gt;| eval avgResponse=round(avgResponse,2)&lt;BR /&gt;| eval nintyPerc=round(nintyPerc,2)&lt;BR /&gt;| table url method kubernetes_cluster hits avgResponse nintyPerc&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Prewin&lt;BR /&gt;Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 08:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combining-2-searches-with-dynamic-urls-into-1/m-p/748571#M242009</guid>
      <dc:creator>PrewinThomas</dc:creator>
      <dc:date>2025-06-24T08:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: combining 2 searches - with dynamic urls into 1</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combining-2-searches-with-dynamic-urls-into-1/m-p/748572#M242010</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253204"&gt;@super_edition&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you could try something like this (see my approach and adapt it to your data):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"  kubernetes_namespace="my_ns"  kubernetes_cluster!="bad_cluster" kubernetes_deployment_name="frontend_service" msg="RESPONSE" ("/my_service/user-registration" OR "/my_service/profile-retrieval")
| eval url=if(searchmatch("/my_service/profile-retrieval"),"/my_service/profile-retrieval","/my_service/user-registration")
| stats count as hits avg(responseTime) as avgResponse perc90(responseTime) as nintyPerc by url method kubernetes_cluster
| eval avgResponse=round(avgResponse,2) 
| eval nintyPerc=round(nintyPerc,2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 08:27:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combining-2-searches-with-dynamic-urls-into-1/m-p/748572#M242010</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-06-24T08:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: combining 2 searches - with dynamic urls into 1</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combining-2-searches-with-dynamic-urls-into-1/m-p/748574#M242011</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/28010"&gt;@PrewinThomas&lt;/a&gt;&amp;nbsp;-&amp;nbsp; it worked as expected and was fast enough.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 09:33:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combining-2-searches-with-dynamic-urls-into-1/m-p/748574#M242011</guid>
      <dc:creator>super_edition</dc:creator>
      <dc:date>2025-06-24T09:33:10Z</dc:date>
    </item>
  </channel>
</rss>

