Overview
This article explains how to search the Okta System Log, export the results to a CSV file, and email it to Okta Workflows.
Applies To
- Okta Workflows
- Okta Classic Engine
- Okta Identity Engine
Solution
The automation has several steps:
- Search the Okta System Log.
- Save the result into a table.
- Export the table data to a CSV file.
- Send an email with the CSV file.
Search log flow
Email System Log search results.
The flow has the following steps:
- Get the current time
The Date & Time—Now card returns the current date and time.
- Search since date
Search the Okta System Log since a specific date in the past. The Subtract card subtracts days from the current time. The flow above searches 30 days since today.
- Clear the table
The Tables—Clear Table card clears the table before saving the search results to a table.
- Search the System Log
The Okta—Search Systems Logs card searches the Okta System Log using a custom query. The Search the System Log in Okta Workflows guide shows how to set up the search query.
- Pass the list to a helper flow
The List—For Each card passes the result list to a helper flow. The helper flow extracts data from each record and saves the data into a table.
- Export to CSV
The Tables—Export to CSV card exports the table data to a CSV file after the helper flow saves every record into a table.
- Send email
The Gmail—Send Email with Attachment card sends an email with the CSV file.
Search log helper flow
This is the helper flow:
Save search record data into a table.
The flow has the following steps:
- Search record
The Helper Flow card passes each search record (the Record field) to the flow.
- Extract fields from the record
The Object—Get Multiple card extracts the fields to save.
- Save into a table
The Tables—Create Row card saves search record information into a table.
