<?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 create a search that should map a session from an internal application to the corresponding VPN session? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591258#M205835</link>
    <description>&lt;P&gt;Hey guys,&lt;/P&gt;
&lt;P&gt;I`m trying to create a search that should map a session from an internal application to the corresponding VPN session.&lt;/P&gt;
&lt;P&gt;Main search - fields: IP_ADDRESS, USER_AD, _time - internal application login sessions&lt;/P&gt;
&lt;P&gt;Sub search - fields: Framed_IP_Address, User_Name, _time - VPN allocating internal IP.&lt;/P&gt;
&lt;P&gt;Basically my approach was to join left the VPN search, to main search (internal application login sessions) by Internal IP, but the main problem is that when the results table is displayed, it will map the first VPN session that is found with the specified IP_Address from the join, and I need to map the latest IP allocation.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;IP 10.0.0.1 was allocated to user x&amp;nbsp; at 10:00. - user x did not attempt to log into internal app.&lt;/P&gt;
&lt;P&gt;IP 10.0.0.1 was allocated to user y0 at 10:40.&lt;/P&gt;
&lt;P&gt;IP 10.0.0.1 made a login session for user y1 at 11:00.&lt;/P&gt;
&lt;P&gt;My table of results will display:&lt;/P&gt;
&lt;P&gt;user x, user y1, 10.0.0.1, 10.0.0.1, 11:00, 10:00&lt;/P&gt;
&lt;P&gt;Instead of :&lt;/P&gt;
&lt;P&gt;user y0, user y1, 10.0.0.1, 10.0.0.1, 11:00, 10:40&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand from join command documentation that&amp;nbsp;&amp;nbsp;"join left=L right=R usetime=true earlier=true where L.IP_ADDRESS=R.Framed_IP_Address" shall look for the IP in the internal app login session, and it will map it with the first event that has that IP in the VPN allocation search, prior to the internal application session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please help me to get the latest VPN session for the IP that is matched in the internal application login session instead of the earliest(as it is by default in join command)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index=x host=internal_application&lt;BR /&gt;| eval time2=strftime(_time, "%m/%d/%y %I:%M:%S:%p")&lt;BR /&gt;| join left=L right=R usetime=true earlier=true where L.IP_ADDRESS=R.Framed_IP_Address [search index=x sourcetype="cisco:acs" Acct_Status_Type=Interim-Update earliest=-12h latest=-1m&lt;BR /&gt;| eval time1=strftime(_time, "%m/%d/%y %I:%M:%S:%p")]&lt;BR /&gt;| table R.User_Name, L.USER_AD, R.Framed_IP_Address, L.IP_ADDRESS, L.time2, R.time1&lt;BR /&gt;| rename R.User_Name as VPN_User, L.USER_AD as Hercules_user, R.Framed_IP_Address as "IP assigned by VPN", L.IP_ADDRESS as "IP Hercules", L.time2 as "User connecting at", R.time1 as "IP allocation time"&lt;BR /&gt;| eval Hercules_user=lower(Hercules_user)&lt;BR /&gt;| where Hercules_user!=VPN_User&lt;BR /&gt;| table VPN_User, Hercules_user, "IP assigned by VPN", "IP Hercules", "User connecting at", "IP allocation time"&lt;/P&gt;</description>
    <pubDate>Tue, 29 Mar 2022 16:11:02 GMT</pubDate>
    <dc:creator>alexandrucrc</dc:creator>
    <dc:date>2022-03-29T16:11:02Z</dc:date>
    <item>
      <title>How to create a search that should map a session from an internal application to the corresponding VPN session?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591258#M205835</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;
&lt;P&gt;I`m trying to create a search that should map a session from an internal application to the corresponding VPN session.&lt;/P&gt;
&lt;P&gt;Main search - fields: IP_ADDRESS, USER_AD, _time - internal application login sessions&lt;/P&gt;
&lt;P&gt;Sub search - fields: Framed_IP_Address, User_Name, _time - VPN allocating internal IP.&lt;/P&gt;
&lt;P&gt;Basically my approach was to join left the VPN search, to main search (internal application login sessions) by Internal IP, but the main problem is that when the results table is displayed, it will map the first VPN session that is found with the specified IP_Address from the join, and I need to map the latest IP allocation.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;IP 10.0.0.1 was allocated to user x&amp;nbsp; at 10:00. - user x did not attempt to log into internal app.&lt;/P&gt;
&lt;P&gt;IP 10.0.0.1 was allocated to user y0 at 10:40.&lt;/P&gt;
&lt;P&gt;IP 10.0.0.1 made a login session for user y1 at 11:00.&lt;/P&gt;
&lt;P&gt;My table of results will display:&lt;/P&gt;
&lt;P&gt;user x, user y1, 10.0.0.1, 10.0.0.1, 11:00, 10:00&lt;/P&gt;
&lt;P&gt;Instead of :&lt;/P&gt;
&lt;P&gt;user y0, user y1, 10.0.0.1, 10.0.0.1, 11:00, 10:40&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand from join command documentation that&amp;nbsp;&amp;nbsp;"join left=L right=R usetime=true earlier=true where L.IP_ADDRESS=R.Framed_IP_Address" shall look for the IP in the internal app login session, and it will map it with the first event that has that IP in the VPN allocation search, prior to the internal application session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please help me to get the latest VPN session for the IP that is matched in the internal application login session instead of the earliest(as it is by default in join command)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index=x host=internal_application&lt;BR /&gt;| eval time2=strftime(_time, "%m/%d/%y %I:%M:%S:%p")&lt;BR /&gt;| join left=L right=R usetime=true earlier=true where L.IP_ADDRESS=R.Framed_IP_Address [search index=x sourcetype="cisco:acs" Acct_Status_Type=Interim-Update earliest=-12h latest=-1m&lt;BR /&gt;| eval time1=strftime(_time, "%m/%d/%y %I:%M:%S:%p")]&lt;BR /&gt;| table R.User_Name, L.USER_AD, R.Framed_IP_Address, L.IP_ADDRESS, L.time2, R.time1&lt;BR /&gt;| rename R.User_Name as VPN_User, L.USER_AD as Hercules_user, R.Framed_IP_Address as "IP assigned by VPN", L.IP_ADDRESS as "IP Hercules", L.time2 as "User connecting at", R.time1 as "IP allocation time"&lt;BR /&gt;| eval Hercules_user=lower(Hercules_user)&lt;BR /&gt;| where Hercules_user!=VPN_User&lt;BR /&gt;| table VPN_User, Hercules_user, "IP assigned by VPN", "IP Hercules", "User connecting at", "IP allocation time"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 16:11:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591258#M205835</guid>
      <dc:creator>alexandrucrc</dc:creator>
      <dc:date>2022-03-29T16:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Join issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591265#M205840</link>
      <description>&lt;P&gt;Try sorting the events you are joining&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=x host=internal_application
| eval time2=strftime(_time, "%m/%d/%y %I:%M:%S:%p")
| join left=L right=R usetime=true earlier=true where L.IP_ADDRESS=R.Framed_IP_Address [search index=x sourcetype="cisco:acs" Acct_Status_Type=Interim-Update earliest=-12h latest=-1m
| sort 0 -_time
| eval time1=strftime(_time, "%m/%d/%y %I:%M:%S:%p")]
| table R.User_Name, L.USER_AD, R.Framed_IP_Address, L.IP_ADDRESS, L.time2, R.time1
| rename R.User_Name as VPN_User, L.USER_AD as Hercules_user, R.Framed_IP_Address as "IP assigned by VPN", L.IP_ADDRESS as "IP Hercules", L.time2 as "User connecting at", R.time1 as "IP allocation time"
| eval Hercules_user=lower(Hercules_user)
| where Hercules_user!=VPN_User
| table VPN_User, Hercules_user, "IP assigned by VPN", "IP Hercules", "User connecting at", "IP allocation time"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Mar 2022 13:59:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591265#M205840</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-29T13:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Join issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591274#M205843</link>
      <description>&lt;P&gt;Thanks for your reply, your help is very much appreciated!&lt;/P&gt;&lt;P&gt;I`ve tried sort but the same results are displayed as without sorting.&lt;/P&gt;&lt;P&gt;I`ve also tried sort and head and did not work.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 14:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591274#M205843</guid>
      <dc:creator>alexandrucrc</dc:creator>
      <dc:date>2022-03-29T14:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Join issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591276#M205844</link>
      <description>&lt;P&gt;Have you tried with earlier=false&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 14:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591276#M205844</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-29T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Join issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591288#M205845</link>
      <description>&lt;P&gt;Yes sir, I did, but changing this parameter would make my search useless as I`m trying to find VPN sessions that were active prior to the login in the internal app.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 15:18:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591288#M205845</guid>
      <dc:creator>alexandrucrc</dc:creator>
      <dc:date>2022-03-29T15:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Join issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591293#M205848</link>
      <description>&lt;P&gt;Please can you share some anonymised events from your searches so we can see what it is you are dealing with?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 15:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-that-should-map-a-session-from-an/m-p/591293#M205848</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-29T15:32:13Z</dc:date>
    </item>
  </channel>
</rss>

