Skip to content

Commit 7cf4366

Browse files
Merge pull request #303690 from EdB-MSFT/notebook-examples
updated SigninLogs
2 parents f6577c9 + 19a70fe commit 7cf4366

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

articles/sentinel/datalake/notebook-examples.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ To run these examples, must have the required permissions and Visual Studio Code
2222
## Failed sign-in attempts analysis
2323

2424
This example identifies users with failed sign-in attempts. To do so, this notebook example processes sign-in data from two tables:
25-
+ microsoft.entra.id.SignInLogs
26-
+ microsoft.entra.id.AADNonInteractiveUserSignInLogs
25+
+ SigninLogs
26+
+ AADNonInteractiveUserSignInLogs
2727

2828
The notebook performs the following steps:
2929
1. Create a function to process data from the specified tables, which includes:
@@ -32,7 +32,7 @@ The notebook performs the following steps:
3232
1. Aggregate the data to count the number of failed and successful sign-in attempts for each user.
3333
1. Filter the data to include only users with more than 100 failed sign-in attempts and at least one successful sign-in attempt.
3434
1. Order the results by the number of failed sign-in attempts.
35-
1. Call the function for both `SignInLogs` and `AADNonInteractiveUserSignInLogs` tables.
35+
1. Call the function for both `SigninLogs` and `AADNonInteractiveUserSignInLogs` tables.
3636
1. Combine the results from both tables into a single DataFrame.
3737
1. Convert the DataFrame to a Pandas DataFrame.
3838
1. Filter the Pandas DataFrame to show the top 20 users with the highest number of failed sign-in attempts.
@@ -81,7 +81,7 @@ def process_data(table_name,workspace_name):
8181

8282
# Process the tables to a common schema
8383
workspace_name = "your-workspace-name" # Replace with your actual workspace name
84-
aad_signin = process_data("SignInLogs", workspace_name)
84+
aad_signin = process_data("SigninLogs", workspace_name)
8585
aad_non_int = process_data("AADNonInteractiveUserSignInLogs", workspace_name)
8686

8787
# Union the DataFrames
@@ -131,13 +131,13 @@ The following screenshot shows a sample of the output of the code above, display
131131

132132
## Access Microsoft Entra ID sign-in logs for a specific user
133133

134-
The following code sample demonstrates how to access the Microsoft Entra ID `SignInLogs` table and filter the results for a specific user. It retrieves various fields such as UserDisplayName, UserPrincipalName, UserId, and more.
134+
The following code sample demonstrates how to access the Microsoft Entra ID `SigninLogs` table and filter the results for a specific user. It retrieves various fields such as UserDisplayName, UserPrincipalName, UserId, and more.
135135

136136
```python
137137
from sentinel_lake.providers import MicrosoftSentinelProvider
138138
data_provider = MicrosoftSentinelProvider(spark)
139139

140-
table_name = "SignInLogs"
140+
table_name = "SigninLogs"
141141
workspace_name = "your-workspace-name" # Replace with your actual workspace name
142142
df = data_provider.read_table(table_name, workspace_name)
143143
df.select("UserDisplayName", "UserPrincipalName", "UserId", "CorrelationId", "UserType",
@@ -149,7 +149,7 @@ df.select("UserDisplayName", "UserPrincipalName", "UserId", "CorrelationId", "Us
149149

150150
## Examine sign-in locations
151151

152-
The following code sample demonstrates how to extract and display sign-in locations from the Microsoft Entra ID SignInLogs table. It uses the `from_json` function to parse the JSON structure of the `LocationDetails` field, allowing you to access specific location attributes such as city, state, and country or region.
152+
The following code sample demonstrates how to extract and display sign-in locations from the Microsoft Entra ID SigninLogs table. It uses the `from_json` function to parse the JSON structure of the `LocationDetails` field, allowing you to access specific location attributes such as city, state, and country or region.
153153

154154
```python
155155
from sentinel_lake.providers import MicrosoftSentinelProvider
@@ -158,7 +158,7 @@ from pyspark.sql.types import StructType, StructField, StringType
158158

159159
data_provider = MicrosoftSentinelProvider(spark)
160160
workspace_name = "your-workspace-name" # Replace with your actual workspace name
161-
table_name = "SignInLogs"
161+
table_name = "SigninLogs"
162162
df = data_provider.read_table(table_name, workspace_name)
163163

164164
location_schema = StructType([
@@ -240,7 +240,7 @@ def process_data(table_name, workspace_name):
240240
.withColumn("IPCustomEntity", col("IPAddress"))
241241
return df
242242
workspace_name = "your-workspace-name" # Replace with your actual workspace name
243-
aad_signin = process_data("SignInLogs", workspace_name)
243+
aad_signin = process_data("SigninLogs", workspace_name)
244244
aad_non_int = process_data("AADNonInteractiveUserSignInLogs",workspace_name)
245245
result_df = aad_signin.unionByName(aad_non_int)
246246
result_df.show()

0 commit comments

Comments
 (0)