<?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 Combinding two searches into one in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576415#M200879</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I do appreciate this question has been asked several times, but I am struggling to understand how to link searches together.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have search A that highlights what src_ip communicated with dest_ip on a specific port-&amp;nbsp;&lt;/P&gt;&lt;P&gt;(index=netfw OR index=netproxy) AND ("192.168.*.*") AND (dest_port="23")&lt;BR /&gt;| table src_ip, dest_ip, dest_port, _time&lt;/P&gt;&lt;P&gt;I then take the results from the src_ip and link it to the second search in a new tab to find the computer hostname from the src_ip via DHCP logs -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;index=oswinsec sourcetype=dhcp ip=192.168.*.*&lt;BR /&gt;| table ip, dest, date, time&lt;BR /&gt;&lt;BR /&gt;Is it at all possible to combine these so when I do a search on a specific destination IP, the results src_ip is converted into the hostnames found in the DHCP source type?&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
    <pubDate>Fri, 26 Nov 2021 11:32:59 GMT</pubDate>
    <dc:creator>amagson</dc:creator>
    <dc:date>2021-11-26T11:32:59Z</dc:date>
    <item>
      <title>Combinding two searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576415#M200879</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I do appreciate this question has been asked several times, but I am struggling to understand how to link searches together.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have search A that highlights what src_ip communicated with dest_ip on a specific port-&amp;nbsp;&lt;/P&gt;&lt;P&gt;(index=netfw OR index=netproxy) AND ("192.168.*.*") AND (dest_port="23")&lt;BR /&gt;| table src_ip, dest_ip, dest_port, _time&lt;/P&gt;&lt;P&gt;I then take the results from the src_ip and link it to the second search in a new tab to find the computer hostname from the src_ip via DHCP logs -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;index=oswinsec sourcetype=dhcp ip=192.168.*.*&lt;BR /&gt;| table ip, dest, date, time&lt;BR /&gt;&lt;BR /&gt;Is it at all possible to combine these so when I do a search on a specific destination IP, the results src_ip is converted into the hostnames found in the DHCP source type?&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 11:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576415#M200879</guid>
      <dc:creator>amagson</dc:creator>
      <dc:date>2021-11-26T11:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Combinding two searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576423#M200880</link>
      <description>&lt;LI-CODE lang="markup"&gt;(index=netfw OR index=netproxy) AND ("192.168.*.*") AND (dest_port="23")
| table src_ip, dest_ip, dest_port, _time
| join type=left src_ip
  [ search index=oswinsec sourcetype=dhcp ip=192.168.*.*
  | table ip, dest, date, time
  | rename ip as src_ip]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 26 Nov 2021 13:23:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576423#M200880</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-26T13:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Combinding two searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576426#M200881</link>
      <description>&lt;P&gt;I don't know if this gives exactly what you mean and I can't test it but maybe you can give it a try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=netfw OR index=netproxy) AND ("192.168.*.*") AND (dest_port="23") 
| where dest_ip="xxx" 
| table src_ip, dest_ip, dest_port, _time 
| join type=outer src_ip 
    [ search index=oswinsec sourcetype=dhcp ip=192.168.*.* 
    | eval src_ip=ip] 
| table src_ip, dest, date, time hostname&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it doesn't work can you describe what goes wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 13:33:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576426#M200881</guid>
      <dc:creator>rrovers</dc:creator>
      <dc:date>2021-11-26T13:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Combinding two searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576441#M200885</link>
      <description>&lt;P&gt;Hi thank you for the post&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So the top part&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;(index=netfw OR index=netproxy) AND ("192.168.*.*") AND (dest_port="23")&lt;/PRE&gt;&lt;P&gt;after the first AND, the IP here should be dest_ip="192.168.*.* followed by the dest port&lt;BR /&gt;&lt;BR /&gt;what i want, is for the IPs found (src_ip) communicating with the dest_ip to be converted into hotnames from the -&lt;/P&gt;&lt;PRE&gt;index=oswinsec sourcetype=dhcp&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Nov 2021 15:06:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576441#M200885</guid>
      <dc:creator>amagson</dc:creator>
      <dc:date>2021-11-26T15:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Combinding two searches into one</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576561#M200933</link>
      <description>&lt;P&gt;I'm not sure if your case is clear to me.&lt;/P&gt;&lt;P&gt;In general, you have a collection A and you have a collection B. There is at least 1 field in common. You can use that field to relate the collections with a join. To relate the fields they must have the same name. You can use eval for that. Once they are related you can use the fields in collection B as output of your search.&lt;/P&gt;&lt;P&gt;So:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=netfw OR index=netproxy) AND dest_ip=("192.168.*.*") AND (dest_port="23")&lt;/LI-CODE&gt;&lt;P&gt;gives a src_ip as a result.&lt;/P&gt;&lt;P&gt;Your collection B is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=oswinsec sourcetype=dhcp ip=192.168.*.*&lt;/LI-CODE&gt;&lt;P&gt;The ip you use here is the src_ip of collection B.&amp;nbsp; You should use&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;eval src_ip=ip&lt;/LI-CODE&gt;&lt;P&gt;if you want to use src_ip in the join (because the fields in the join must have the same name).&lt;/P&gt;&lt;P&gt;So maybe something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=netfw OR index=netproxy) AND ("192.168.*.*") AND (dest_port="23") 
| where dest_ip="192.168.*.*" 
| join type=inner src_ip 
    [ search index=oswinsec sourcetype=dhcp 
        ] 
| table date time src_ip dest_ip hostname&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;if in the index=oswinsec the src_ip has a different name you could use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;eval src_ip=[different name for src_ip]&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Nov 2021 07:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combinding-two-searches-into-one/m-p/576561#M200933</guid>
      <dc:creator>rrovers</dc:creator>
      <dc:date>2021-11-29T07:33:53Z</dc:date>
    </item>
  </channel>
</rss>

