<?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 join two tables for more data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-for-more-data/m-p/700869#M237776</link>
    <description>&lt;P&gt;Good day,&lt;BR /&gt;&lt;BR /&gt;I have done a join on two indexes before to add more information to one event. example get department for a user from network events. But now I want to add two indexes to give me more data.&amp;nbsp;&lt;BR /&gt;Example index one will display:&lt;BR /&gt;host 1 10.0.0.2&lt;BR /&gt;host 2 10.0.0.3&lt;BR /&gt;And index two will display:&amp;nbsp;&lt;BR /&gt;host 3 10.0.0.4&lt;BR /&gt;host 1 10.0.0.2&lt;BR /&gt;What I want is:&lt;BR /&gt;host 1 10.0.0.2&lt;BR /&gt;host 2 10.0.0.3&lt;BR /&gt;host 3 10.0.0.4&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=db_azure_activity sourcetype=azure:monitor:activity  change_type="virtual machine"
| rename "identity.authorization.evidence.roleAssignmentScope" as subscription
| dedup object
| where command!="MICROSOFT.COMPUTE/VIRTUALMACHINES/DELETE"
| table  change_type object resource_group subscription command _time 
| sort object asc


index=* sourcetype=o365:management:activity 
| rename "PropertyBag{}.AssessmentStatusPerInitiative{}.ResourceName" as ResourceName
| rename "PropertyBag{}.AssessmentStatusPerInitiative{}.CloudProvider" as CloudProvider
| rename "PropertyBag{}.AssessmentStatusPerInitiative{}.ResourceType" as ResourceTypes
| rename "PropertyBag{}.AssessmentStatusPerInitiative{}.EventType" as EventType
| where ResourceTypes="Microsoft.Compute/virtualMachines" OR ResourceTypes="microsoft.compute/virtualmachines"
| eval object=mvdedup(split(ResourceName," "))
| eval Provider=mvdedup(split(CloudProvider," "))
| eval Type=mvdedup(split(ResourceTypes," "))
| dedup object
| where EventType!="Microsoft.Security/assessments/Delete"
| table object, Provider, Type *
| sort object asc&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 03 Oct 2024 09:21:14 GMT</pubDate>
    <dc:creator>JandrevdM</dc:creator>
    <dc:date>2024-10-03T09:21:14Z</dc:date>
    <item>
      <title>How to join two tables for more data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-for-more-data/m-p/700869#M237776</link>
      <description>&lt;P&gt;Good day,&lt;BR /&gt;&lt;BR /&gt;I have done a join on two indexes before to add more information to one event. example get department for a user from network events. But now I want to add two indexes to give me more data.&amp;nbsp;&lt;BR /&gt;Example index one will display:&lt;BR /&gt;host 1 10.0.0.2&lt;BR /&gt;host 2 10.0.0.3&lt;BR /&gt;And index two will display:&amp;nbsp;&lt;BR /&gt;host 3 10.0.0.4&lt;BR /&gt;host 1 10.0.0.2&lt;BR /&gt;What I want is:&lt;BR /&gt;host 1 10.0.0.2&lt;BR /&gt;host 2 10.0.0.3&lt;BR /&gt;host 3 10.0.0.4&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=db_azure_activity sourcetype=azure:monitor:activity  change_type="virtual machine"
| rename "identity.authorization.evidence.roleAssignmentScope" as subscription
| dedup object
| where command!="MICROSOFT.COMPUTE/VIRTUALMACHINES/DELETE"
| table  change_type object resource_group subscription command _time 
| sort object asc


index=* sourcetype=o365:management:activity 
| rename "PropertyBag{}.AssessmentStatusPerInitiative{}.ResourceName" as ResourceName
| rename "PropertyBag{}.AssessmentStatusPerInitiative{}.CloudProvider" as CloudProvider
| rename "PropertyBag{}.AssessmentStatusPerInitiative{}.ResourceType" as ResourceTypes
| rename "PropertyBag{}.AssessmentStatusPerInitiative{}.EventType" as EventType
| where ResourceTypes="Microsoft.Compute/virtualMachines" OR ResourceTypes="microsoft.compute/virtualmachines"
| eval object=mvdedup(split(ResourceName," "))
| eval Provider=mvdedup(split(CloudProvider," "))
| eval Type=mvdedup(split(ResourceTypes," "))
| dedup object
| where EventType!="Microsoft.Security/assessments/Delete"
| table object, Provider, Type *
| sort object asc&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Oct 2024 09:21:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-for-more-data/m-p/700869#M237776</guid>
      <dc:creator>JandrevdM</dc:creator>
      <dc:date>2024-10-03T09:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two tables for more data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-for-more-data/m-p/700870#M237777</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270694"&gt;@JandrevdM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Splunk has the join command but I don't hint it because it's very slow and requires many resources.&lt;/P&gt;&lt;P&gt;if you have less than 50,000 results in the second search, you could use this solution joining events using stats command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=db_azure_activity sourcetype=azure:monitor:activity  change_type="virtual machine"
| rename "identity.authorization.evidence.roleAssignmentScope" AS subscription
| dedup object
| where command!="MICROSOFT.COMPUTE/VIRTUALMACHINES/DELETE"
| table  change_type object resource_group subscription command _time 
| sort object asc
| append [ search
     index=* sourcetype=o365:management:activity 
     | rename 
          "PropertyBag{}.AssessmentStatusPerInitiative{}.ResourceName" as ResourceName
          "PropertyBag{}.AssessmentStatusPerInitiative{}.CloudProvider" as CloudProvider
          "PropertyBag{}.AssessmentStatusPerInitiative{}.ResourceType" as ResourceTypes
          "PropertyBag{}.AssessmentStatusPerInitiative{}.EventType" as EventType
     | where ResourceTypes="Microsoft.Compute/virtualMachines" OR ResourceTypes="microsoft.compute/virtualmachines"
     | eval 
          object=mvdedup(split(ResourceName," ")),
          Provider=mvdedup(split(CloudProvider," ")),
          Type=mvdedup(split(ResourceTypes," "))
     | dedup object
     | where EventType!="Microsoft.Security/assessments/Delete"
     | table object, Provider, Type *
     | sort object asc ]
| stats values(*) AS * BY object&lt;/LI-CODE&gt;&lt;P&gt;eventually limiting the fields to display related to your requirements.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 09:27:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-for-more-data/m-p/700870#M237777</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-10-03T09:27:38Z</dc:date>
    </item>
  </channel>
</rss>

