<?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 How to combine result of two query where there is common field after renaming . in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-result-of-two-query-where-there-is-common-field/m-p/532660#M150476</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp; I have two query as below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;index is same, where as sourcetype and source is different on both query.&lt;/P&gt;&lt;P&gt;There is field call "Vserver"( After rename )&amp;nbsp; and "host" whose value&amp;nbsp; is same on both the query. This field can be taken as a reference for both the query.&lt;/P&gt;&lt;P&gt;I want to combine the result of the both the query&amp;nbsp; so that, I can have&amp;nbsp; query-2&amp;nbsp; "vol_count"&amp;nbsp; output in&amp;nbsp;query-1 table output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone please help me .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Shyam&lt;/P&gt;&lt;P&gt;query-1 :-&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=infra_netapp sourcetype="ontap:vserver" source="vserver-get-iter" | rename vserver-name AS Vserver&lt;BR /&gt;| dedup Vserver&lt;BR /&gt;| regex Vserver="^([a-zA-Z]+)-([a-z]{0,2})([1-9]{1,2})pri(\d{1,4})"&amp;nbsp;&lt;BR /&gt;| eval VserverCatagory=case(&lt;BR /&gt;match(Vserver, "^([a-zA-Z]+)-([a-z]{0,2})HD(\d{1,4})"),&lt;BR /&gt;"Home",&lt;BR /&gt;match(Vserver,"^([a-zA-Z]+)-([a-z]{0,2})GD(\d{1,4})"),&lt;BR /&gt;"GD",&lt;BR /&gt;match(Vserver,"^([a-zA-Z]+)-([a-z]{0,2})AD(\d{1,4})"),&lt;BR /&gt;"AD",&lt;BR /&gt;match(Vserver,"^([a-zA-Z]+)-([a-z]{0,2})UD(\d{1,4})"),&lt;BR /&gt;"UD",&lt;BR /&gt;1==1,"Unknown")&lt;BR /&gt;| table host, Vserver,vserver-type,state,VserverCatagory,operational-state&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query-2 :-&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=infra_netapp sourcetype="ontap:volume" source="volume-get-iter" | rename volume-id-attributes.name as Volume, volume-id-attributes.owning-vserver-name as Vserver&lt;BR /&gt;| regex Vserver="^([a-zA-Z]+)-([a-z]{0,2})([1-9]{1,2})pri(\d{1,4})"&lt;BR /&gt;| stats dc(Volume) AS vol_count BY host, Vserver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 15:06:05 GMT</pubDate>
    <dc:creator>shyambiswal</dc:creator>
    <dc:date>2020-12-10T15:06:05Z</dc:date>
    <item>
      <title>How to combine result of two query where there is common field after renaming .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-result-of-two-query-where-there-is-common-field/m-p/532660#M150476</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp; I have two query as below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;index is same, where as sourcetype and source is different on both query.&lt;/P&gt;&lt;P&gt;There is field call "Vserver"( After rename )&amp;nbsp; and "host" whose value&amp;nbsp; is same on both the query. This field can be taken as a reference for both the query.&lt;/P&gt;&lt;P&gt;I want to combine the result of the both the query&amp;nbsp; so that, I can have&amp;nbsp; query-2&amp;nbsp; "vol_count"&amp;nbsp; output in&amp;nbsp;query-1 table output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone please help me .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Shyam&lt;/P&gt;&lt;P&gt;query-1 :-&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=infra_netapp sourcetype="ontap:vserver" source="vserver-get-iter" | rename vserver-name AS Vserver&lt;BR /&gt;| dedup Vserver&lt;BR /&gt;| regex Vserver="^([a-zA-Z]+)-([a-z]{0,2})([1-9]{1,2})pri(\d{1,4})"&amp;nbsp;&lt;BR /&gt;| eval VserverCatagory=case(&lt;BR /&gt;match(Vserver, "^([a-zA-Z]+)-([a-z]{0,2})HD(\d{1,4})"),&lt;BR /&gt;"Home",&lt;BR /&gt;match(Vserver,"^([a-zA-Z]+)-([a-z]{0,2})GD(\d{1,4})"),&lt;BR /&gt;"GD",&lt;BR /&gt;match(Vserver,"^([a-zA-Z]+)-([a-z]{0,2})AD(\d{1,4})"),&lt;BR /&gt;"AD",&lt;BR /&gt;match(Vserver,"^([a-zA-Z]+)-([a-z]{0,2})UD(\d{1,4})"),&lt;BR /&gt;"UD",&lt;BR /&gt;1==1,"Unknown")&lt;BR /&gt;| table host, Vserver,vserver-type,state,VserverCatagory,operational-state&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query-2 :-&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=infra_netapp sourcetype="ontap:volume" source="volume-get-iter" | rename volume-id-attributes.name as Volume, volume-id-attributes.owning-vserver-name as Vserver&lt;BR /&gt;| regex Vserver="^([a-zA-Z]+)-([a-z]{0,2})([1-9]{1,2})pri(\d{1,4})"&lt;BR /&gt;| stats dc(Volume) AS vol_count BY host, Vserver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:06:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-result-of-two-query-where-there-is-common-field/m-p/532660#M150476</guid>
      <dc:creator>shyambiswal</dc:creator>
      <dc:date>2020-12-10T15:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine result of two query where there is common field after renaming .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-result-of-two-query-where-there-is-common-field/m-p/532674#M150483</link>
      <description>&lt;P&gt;How about something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=infra_netapp (sourcetype="ontap:volume" AND source="volume-get-iter") OR (sourcetype="ontap:vserver" AND source="vserver-get-iter")
| eval Vserver=coalesce(vserver-name, volume-id-attributes.owning-vserver-name)
| regex Vserver="^([a-zA-Z]+)-([a-z]{0,2})([1-9]{1,2})pri(\d{1,4})"
| stats values(host) as host values(vserver-type) as vserver-type values(state) as state values(operational-state) as operational-state dc(volume-id-attributes.name) as vol_count by Vserver
| eval VserverCatagory=case(
match(Vserver, "^([a-zA-Z]+)-([a-z]{0,2})HD(\d{1,4})"),
"Home",
match(Vserver,"^([a-zA-Z]+)-([a-z]{0,2})GD(\d{1,4})"),
"GD",
match(Vserver,"^([a-zA-Z]+)-([a-z]{0,2})AD(\d{1,4})"),
"AD",
match(Vserver,"^([a-zA-Z]+)-([a-z]{0,2})UD(\d{1,4})"),
"UD",
1==1,"Unknown")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Dec 2020 16:35:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-result-of-two-query-where-there-is-common-field/m-p/532674#M150483</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-12-10T16:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine result of two query where there is common field after renaming .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-result-of-two-query-where-there-is-common-field/m-p/532955#M150552</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; ,&amp;nbsp; thanks for replying with query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I use that, I got the volume count, but other value of below is not coming.&lt;/P&gt;&lt;PRE&gt;values(vserver-type) as vserver-type values(state) as state values(operational-state) as operational-state&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 07:19:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-result-of-two-query-where-there-is-common-field/m-p/532955#M150552</guid>
      <dc:creator>shyambiswal</dc:creator>
      <dc:date>2020-12-14T07:19:32Z</dc:date>
    </item>
  </channel>
</rss>

