Auth0 Logs to Mixpanel
The Auth0 Logs to Mixpanel is a scheduled job that takes all of your Auth0 logs and exports them to Mixpanel.
Step 1: Get the required information from Mixpanel
First you need to get some required information from Mixpanel: the Token and API Key that Auth0 will use to connect and push logs.
- Go to Mixpanel
- Click on your Account Settings
- Click on the Projects tab
- Copy the Token and API Key information. These map respectively to the MIXPANEL_TOKEN and MIXPANEL_KEY variables that you will set in the next step
Step 2: Configure Auth0
Go to Dashboard > Extensions and click on the Auth0 Logs to Mixpanel box in the list of provided extensions.
The Install Extension window pops open.
Set the following configuration variables:
- Schedule: The frequency with which logs should be exported. The schedule can be customized even further after creation.
- MIXPANEL_TOKEN: The Mixpanel Token for your mixpanel project to which the Auth0 logs will be exported.
- MIXPANEL_KEY: The Mixpanel API Key for your mixpanel project to which the Auth0 logs will be exported.
- BATCH_SIZE: The amount of logs to be read on each execution. Maximum is 20.
- LOG_LEVEL: The minimal log level of events that you would like sent to Mixpanel.
- LOG_TYPES: The events for which logs should be exported. If you want you can send only events with a specific type (for example, failed logins).
Once you have provided this information, click the Install button to finish installing the extension.
When setting your BATCH_SIZE, please keep the following information in mind.
During each time frame/window (defined by your chosen Schedule), outstanding logs will be batched into groups and sent. The size of each group is determined by the BATCH_SIZE value.
In other words, during each window,
NUM_BATCHES batches of logs will be sent based on the following logic:
IF (NUM_LOGS modulo 100 == 0): NUM_BATCHES = (NUM_LOGS / BATCH_SIZE) ELSE: NUM_BATCHES = (NUM_LOGS / BATCH_SIZE) + 1
ELSE case, the last batch will have < 100 logs.
Use your extension
To view all jobs, navigate to Dashboard > Extensions, click on the Installed Extensions link, and select the Auth0 Logs to Mixpanel line. There you can see the alls job and failed jobs. You can also view the logs of these runs.
You can create a cron webtask (that will run every 10 minutes) or view more details around existing cron webtasks. In the terminal, you can view details for each execution, reschedule, access realtime logs, and more.