<?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: How can I monitor user activity pattern search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/651237#M225152</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Here we get to see the&amp;nbsp;&lt;SPAN&gt;"legacyEventType": "app.auth.sso, I believe this is the one related to auth!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2023 04:43:34 GMT</pubDate>
    <dc:creator>AL3Z</dc:creator>
    <dc:date>2023-07-20T04:43:34Z</dc:date>
    <item>
      <title>How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649872#M224689</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying to figure out the query&amp;nbsp; to identify when users are connecting to the VPN or not.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:28:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649872#M224689</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-24T06:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor user activity pattern search ...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649888#M224693</link>
      <description>&lt;P&gt;It is not immediately clear which field will indicate connection to Okta and which that to Cisco/Anyconnect. &amp;nbsp;So the following will just perform a match with _raw. &amp;nbsp;The best would be to narrowly match designated fields. (One reason this is unclear is because the sample data you give is no longer valid JSON because of some inaccuracy during your anonymization. &amp;nbsp;It would help if you can diagnose JSON, or at the minimum use a pretty print before doing anonymization so volunteers can make an educated guess. &amp;nbsp;But in this problem, it shouldn't matter too much because you already know which fields are of interest.)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your search&amp;gt; earliest=-30d
| eval connect_state = if(match(_raw, "okta"), if(match(_raw, "cisco|anyconnect"), "VPN", "On-prem"), "none")
| timechart span=1d@d values(connect_state) as connect_state&lt;/LI-CODE&gt;&lt;P&gt;Is this something you are looking for?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 18:05:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649888#M224693</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-10T18:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649894#M224695</link>
      <description>&lt;P&gt;..&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:29:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649894#M224695</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-24T06:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor user activity pattern search ...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649918#M224699</link>
      <description>&lt;P&gt;To confirm, the Okta info can be discerned from&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;displayMessage&lt;/FONT&gt; when&amp;nbsp;eventType=user.*, and Cisco Anyconnect info can be from&amp;nbsp;&lt;FONT face="courier new,courier"&gt;targetAppAlternateId&lt;/FONT&gt; when&amp;nbsp;sourcetype=Okta*. &amp;nbsp;Correct? &amp;nbsp;I want to push the solution further by assuming that&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;"User single sign on to app" is the complete value for &lt;FONT face="courier new,courier"&gt;displayMessage&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;targetAppAlternateId&lt;/FONT&gt;&amp;nbsp;begins with "Cisco" or "Anyconnect".&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;These assumptions are used to make the base search narrower. &amp;nbsp;You can adjust these or abandon them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;More importantly for efficiency, usually you want to avoid join. &amp;nbsp;So I'm combining the two searches into the base search. &amp;nbsp;Following that, it's just an exercise of stats.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz ((eventType=user.* displayMessage = "User single sign on to app")
  OR (sourcetype=Okta* (targetAppAlternateId = "cisco *" OR targetAppAlternateId = "anyconnect*")) earliest=-30d
| eval logon = case(match(displayMessage, "User single sign on to app"), "Okta", match(targetAppAlternateId, "anyconnect | Cisco"), "VPN")
| bin span=1d@d _time
| stats values(logon) as logon by _time userid
| eval connectivity_type = if(logon == "Okta", if(logon == "VPN", "VPN", "On-prem"), if(isnull(logon), "none", "!!Anomaly - no Okta, but on VPN"))&lt;/LI-CODE&gt;&lt;P&gt;Given that Cisco Anyconnect only occurs in sourcetype Okta*, &amp;nbsp;the anomaly I'm trying to flag is probably impossible. &amp;nbsp;So, you can get rid of that, too.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 02:23:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649918#M224699</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-11T02:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor user activity pattern search ...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649959#M224717</link>
      <description>&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:30:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/649959#M224717</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-24T06:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor user activity pattern search ...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650101#M224750</link>
      <description>&lt;P&gt;I'm confused. &amp;nbsp;I didn't use anything like 1 == 1. &amp;nbsp;I also did not try to define "none" in case, because it is more expressive to just use if based on your definition of VPN vs on-prem. &amp;nbsp;In fact, if sourcetype is always okta*, the base search can be further simplified. &amp;nbsp;But this begs the question: Can&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;displayMessage&lt;/FONT&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;targetAppAlternateId&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;appear in the same event? &amp;nbsp;If a VPN logon event satisfies both&amp;nbsp;match(targetAppAlternateId, "anyconnect|Cisco") and match(displayMessage, "User single sign on to app"), you would be correct that the anomaly is impossible so you don't have to capture it. &amp;nbsp;The order of the first case function, meanwhile, needs to be adjusted. &amp;nbsp;In fact, it would best be expressed as nested if.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz ((eventType=user.* displayMessage = "User single sign on to app")
  OR (sourcetype=Okta* (targetAppAlternateId = "cisco*" OR targetAppAlternateId = "anyconnect*")) earliest=-30d
| eval logon = case(match(targetAppAlternateId, "anyconnect|Cisco"), "VPN", match(displayMessage, "User single sign on to app"), "Okta")
| bin span=1d@d _time
| stats values(logon) as logon by _time userid
| eval connectivity_type = if(logon == "Okta", if(logon == "VPN", "VPN", "On-prem"), "none")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Jul 2023 06:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650101#M224750</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-12T06:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor user activity pattern search ...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650259#M224797</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How we can bound this to time as last day i was on okta and in the same day i lo&lt;SPAN&gt;gged in via VPN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;so it should show okta and VPN&lt;/P&gt;&lt;P&gt;bounding this with time will be like&lt;/P&gt;&lt;P&gt;Only Okta On Prem&lt;/P&gt;&lt;P&gt;in same day if Okta + VPN = VPN so for same date it should show On Prem &amp;amp; VPN&lt;/P&gt;&lt;P&gt;How we can achieve this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 17:46:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650259#M224797</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-12T17:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor user activity pattern search ...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650296#M224804</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;bounding this with time will be like&lt;P&gt;Only Okta On Prem&lt;/P&gt;&lt;P&gt;in same day if Okta + VPN = VPN so for same date it should show On Prem &amp;amp; VPN&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is the reason why I asked for clarification:&amp;nbsp;&lt;SPAN&gt;Do&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;displayMessage&lt;/FONT&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;targetAppAlternateId&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;appear in the same event? One step further:&amp;nbsp;If I use VPN, will one single event satisfy both&amp;nbsp;&lt;FONT face="courier new,courier"&gt;match(targetAppAlternateId, "anyconnect|Cisco")&lt;/FONT&gt; &lt;STRONG&gt;and&lt;/STRONG&gt; &lt;FONT face="courier new,courier"&gt;match(displayMessage, "User single sign on to app")&lt;/FONT&gt;? &amp;nbsp;My previous reply stated that the search was based on these being true as I inferred from your previous message. &amp;nbsp;If these are not true, my first search should have already covered the case (save some additional assumption about actual matches). &amp;nbsp;To really hone the solution, you will need to illustrate sample data (anonymize as needed), explain key features in the dataset that volunteers will need to pay attention to, and illustrate the desired results.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here, I will relist the past two "solutions" based on data assumptions with some small refinements.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. Solution 2, if a VPN logon will show in single event satisfying&amp;nbsp;&lt;FONT face="courier new,courier"&gt;match(targetAppAlternateId, "anyconnect|Cisco")&lt;/FONT&gt; &lt;STRONG&gt;and&lt;/STRONG&gt; &lt;FONT face="courier new,courier"&gt;match(displayMessage, "User single sign on to app")&lt;/FONT&gt;; an on-prem logon showing only events satisfying &lt;FONT face="courier new,courier"&gt;match(displayMessage, "User single sign on to app")&lt;FONT face="andale mono,times"&gt; &lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT face="courier new,courier"&gt;NOT match(targetAppAlternateId, "anyconnect|Cisco")&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz sourcetype=Okta* ((eventType=user.* displayMessage = "User single sign on to app")
  OR (targetAppAlternateId = "cisco*" OR targetAppAlternateId = "anyconnect*") earliest=-30d
| eval logon = case(match(targetAppAlternateId, "anyconnect|Cisco"), "VPN", match(displayMessage, "User single sign on to app"), "Okta")
| bin span=1d@d _time
| stats values(logon) as logon by _time userid
| eval connectivity_type = if(logon == "Okta", if(logon == "VPN", "VPN", "On-prem"), "none")&lt;/LI-CODE&gt;&lt;P&gt;This should work because &lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;match(targetAppAlternateId, "anyconnect|Cisco")&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;would have implied&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;match(displayMessage, "User single sign on to app")&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;when data characteristics is as described.&lt;/P&gt;&lt;P&gt;2. If Akta logon and VPN logon are totally independent events, i.e.,&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;match(targetAppAlternateId, "anyconnect|Cisco")&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;does not imply &amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;match(displayMessage, "User single sign on to app")&lt;/FONT&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz sourcetype=Okta* ((eventType=user.* displayMessage = "User single sign on to app")
  OR (targetAppAlternateId = "cisco*" OR targetAppAlternateId = "anyconnect*) earliest=-30d
| eval logon = case(match(displayMessage, "User single sign on to app"), "Okta", match(targetAppAlternateId, "anyconnect|Cisco"), "VPN")
| bin span=1d@d _time
| stats values(logon) as logon by _time userid
| eval connectivity_type = if(logon == "Okta", if(logon == "VPN", "VPN", "On-prem"), if(isnull(logon), "none", "!!Anomaly - no Okta, but on VPN"))&lt;/LI-CODE&gt;&lt;P&gt;If your data have other characteristics not covered above, you need to elaborate.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 21:07:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650296#M224804</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-12T21:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor user activity pattern search ...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650309#M224809</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;I apologize for not providing adequate clarification earlier.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Actually when user is on VPN you will see below events&lt;/P&gt;&lt;P&gt;Okta + cisco or Anyconnect&lt;/P&gt;&lt;P&gt;&amp;nbsp;when user is on on-prem you will see only one event&lt;/P&gt;&lt;P&gt;Okta&lt;/P&gt;&lt;P&gt;When user logon from office he is on okta other than office he logon via vpn i.e okta+vpn&lt;BR /&gt;&amp;nbsp; if there are multiple occurrences of logon on the same day&amp;nbsp; then it should show on -prem &amp;amp; vpn .&lt;/P&gt;&lt;P&gt;*with out okta connecting to vpn is not possible *&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 08:28:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650309#M224809</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-13T08:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor user activity pattern search ...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650354#M224824</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Actually when user is on VPN you will see below events&lt;P&gt;Okta + GP or Anyconnect&lt;/P&gt;&lt;P&gt;&amp;nbsp;when user is on on-prem you will see only one event&lt;/P&gt;&lt;P&gt;Okta&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I interpret this as the 2nd scenario in my previous post. &amp;nbsp;Have you tried this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz sourcetype=Okta* ((eventType=user.* displayMessage = "User single sign on to app")
  OR (targetAppAlternateId = "cisco*" OR targetAppAlternateId = "anyconnect*) earliest=-30d
| eval logon = case(match(displayMessage, "User single sign on to app"), "Okta", match(targetAppAlternateId, "anyconnect|Cisco"), "VPN")
| bin span=1d@d _time
| stats values(logon) as logon by _time userid
| eval connectivity_type = if(logon == "Okta", if(logon == "VPN", "VPN", "On-prem"), "none")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;(I removed the anomaly handling but otherwise it's the same.) &amp;nbsp;Please post output if differs from desired results (with illustration of desired results), also illustrate raw events. (If anonymized, make sure to validate JSON. &amp;nbsp;The first posted sample is invalid.)&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 10:01:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650354#M224824</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-13T10:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650355#M224825</link>
      <description>&lt;P&gt;..&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:30:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650355#M224825</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-24T06:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650366#M224833</link>
      <description>&lt;P&gt;You still haven't illustrated what the output from my search is, and demonstrate desired result so I can see the difference; also, you haven't illustrated any valid JSON events to demonstrate what happened when your went on-prem, and what happened when you went home to connect via VPN. &amp;nbsp;Without data, troubleshooting data analytics problems is nearly impossible. &amp;nbsp;Without demonstration of your desired results, a lot of what we discuss is pure speculation.&lt;/P&gt;&lt;P&gt;Perhaps there's a discrepancy between your desired results and your original description, too. &amp;nbsp;You originally said "&lt;SPAN&gt;search by user on a daily basis":&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;if they have accessed OKTA and ( "anyconnect" or Cisco) if they do, we populate VPN connected &lt;STRONG&gt;for that date&lt;/STRONG&gt;. If they only have accessed OKTA and NOT ("anyconnect" or Cisco), then we populate ON Prem Connected &lt;STRONG&gt;for that date&lt;/STRONG&gt;. If they have neither we populate none &lt;STRONG&gt;for the date&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;(Highlights are mine.) &amp;nbsp;This means that for any given date, you only populate one state. &amp;nbsp;This is particularly important with scenario 2, when Okta and VPN logons are independent events. (In scenario 1, you automatically get multiple states if state changes within one day.) &amp;nbsp;What is the criteria to tell which VPN logon is supposed to be grouped with which Okta logon? &amp;nbsp;You have not even described in which order the two type of events would happen in real data if they are associated with one user action. (Also, is such order stable in Splunk? &amp;nbsp;For example, if they occur within 1ms from each other, will Splunk always give the accurate order?)&lt;/P&gt;&lt;P&gt;Suppose Okta happens first, VPN happens second. &amp;nbsp;Your last week's experience (I assume you were describing your change of location within one day) would produce the following events.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Okta logon,&lt;/LI&gt;&lt;LI&gt;Okta logon,&lt;/LI&gt;&lt;LI&gt;VPN logon&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Unless there is a logoff event between 1 and 2 that Splunk is aware of, or if there exist other criteria that you can describe in terms of Splunk data, there is no way to know how the two Okta logon events relate to each other, are they from one user action or two, and so on.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 22:40:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650366#M224833</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-13T22:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650450#M224868</link>
      <description>&lt;P&gt;My output is&amp;nbsp;&lt;BR /&gt;&amp;nbsp; _time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; user&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; logon&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connectivity_type&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 7/13/23&amp;nbsp; &amp;nbsp; &amp;nbsp; xyz&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Okta&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VPN&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VPN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you want me to&amp;nbsp; send _raw event to Json ?&lt;BR /&gt;&lt;BR /&gt;*how we can&amp;nbsp; bound connectivity_type&amp;nbsp; &amp;nbsp;this with time ?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 19:21:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650450#M224868</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-13T19:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650464#M224873</link>
      <description>&lt;P&gt;To get raw JSON even, first search for the events in which user xyz (you) logged on that day, both okta events and VPN events. &amp;nbsp;For JSON events, you'll see a link "Show as raw text" in events window. &amp;nbsp;Click it to get raw text. &amp;nbsp;Load them into an editor and anonymize. (I thought you did this in the original description, except the anonymization did not preserve the original JSON format so the posted text is not valid JSON. &amp;nbsp;Be careful with editing; use a JSON helper/validator if needed.)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="json-event.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26256i4CE65FD48CEC906E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="json-event.png" alt="json-event.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Back to the output. &amp;nbsp;I see that the search correctly captures both logon types. &amp;nbsp;In that case, try another test on user xyz (you) on this day when you had both on-prem and VPN connections.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz sourcetype=Okta* userid="xyz" ((eventType=user.* displayMessage = "User single sign on to app")
  OR (targetAppAlternateId = "cisco*" OR targetAppAlternateId = "anyconnect*) earliest=-30d
| eval logon = case(match(displayMessage, "User single sign on to app"), "Okta", match(targetAppAlternateId, "anyconnect|Cisco"), "VPN")
| eval timestamp = strftime(_time, "%FT%H:%M:%S")
| where isnotnull(logon)
| bin span=1d@d _time
| stats list(logon) as logon list(timestamp) as timestamp by _time userid
| eval connectivity_type = if(logon == "Okta", if(logon == "VPN", "VPN", "On-prem"), "none")&lt;/LI-CODE&gt;&lt;P&gt;What is the output? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 23:07:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650464#M224873</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-13T23:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650982#M225073</link>
      <description>&lt;P&gt;...&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:33:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650982#M225073</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-24T06:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650985#M225074</link>
      <description>&lt;P&gt;..&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:33:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/650985#M225074</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-24T06:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/651061#M225102</link>
      <description>&lt;P&gt;Let's settle one subject at a time. (It would be much easier if you posted output in text.) &amp;nbsp;So, on this given day, you had two pairs of logon events. &amp;nbsp;From first (top) to last (bottom):&lt;/P&gt;&lt;TABLE border="1" width="38.930318813131315%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="2.949852507374631%"&gt;1&lt;/TD&gt;&lt;TD width="31.39358183605972%"&gt;2023-06-21T10:12:09&lt;/TD&gt;&lt;TD width="4.590477958978534%"&gt;VPN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="2.949852507374631%"&gt;2&lt;/TD&gt;&lt;TD width="31.39358183605972%"&gt;2023-06-21T10:12:09&lt;/TD&gt;&lt;TD width="4.590477958978534%"&gt;Okta&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="2.949852507374631%"&gt;3&lt;/TD&gt;&lt;TD width="31.39358183605972%"&gt;2023-06-21T17:18:03&lt;/TD&gt;&lt;TD width="4.590477958978534%"&gt;VPN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="2.949852507374631%"&gt;4&lt;/TD&gt;&lt;TD width="31.39358183605972%"&gt;2023-06-21T17:18:03&lt;/TD&gt;&lt;TD width="4.590477958978534%"&gt;Okta&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;First of all, I observe that events in each pair happened within the same calendar second. &amp;nbsp;Is this sufficient condition to deem 1-2 the same user action, and 3-4 the same?&lt;/P&gt;&lt;P&gt;Secondly, how does this indicate that one of them is from home, one of them on-prem? &amp;nbsp;To me, these two pairs indicate the exact same kind of user action, namely at home.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 05:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/651061#M225102</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-19T05:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/651073#M225109</link>
      <description>&lt;P&gt;..&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:38:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/651073#M225109</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-24T06:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/651147#M225140</link>
      <description>&lt;P&gt;...&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:36:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/651147#M225140</guid>
      <dc:creator>AL3Z</dc:creator>
      <dc:date>2023-07-24T06:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I monitor user activity pattern search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/651235#M225150</link>
      <description>&lt;P&gt;I do not understand.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;In this we get to see the Cisco auth ....&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;"actor": {&lt;BR /&gt;"id": "00u12x51ytWyIKps6357",&lt;BR /&gt;"type": "User",&lt;BR /&gt;"alternateId": "xyz.com",&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This event doesn't contain the field&amp;nbsp;targetAppAlternateId at all. &amp;nbsp;How could this yield VPN? &amp;nbsp;For the search to show VPN, it much satisfy &lt;FONT face="courier new,courier"&gt;match(targetAppAlternateId, "anyconnect|Cisco")&lt;/FONT&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 03:45:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-monitor-user-activity-pattern-search/m-p/651235#M225150</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-20T03:45:51Z</dc:date>
    </item>
  </channel>
</rss>

