Feed events to Splunk
You can feed data to Splunk via Mosaic Events Add-on . This plugin will help you keep track of activity by polling Event streaming API.
Step 1: Configure a management app
In your Mosaic tenant, configure a management app. Give the app a suitable name, for example, MySplunkLogStream
.
Note
After saving the management app, open it again and note the Client ID and Client Secret values. You’ll need these parameters to install the Splunk App.
Step 2: Create event streams
Before you can start feeding events to Splunk, you have to enable data collection and create event streams in Mosaic. You can create as many event streams as needed.
- Enable event collection. Specify the type of events you want to collect.
Example
-
To collect user management events (logins, etc.), use
/activities/start-collect?type=cis
-
To collect detection and response events, use
/activities/start-collect?type=risk
-
To collect identity verification events, use
/activities/start-collect?type=verify
-
To collect admin events, use
/activities/start-collect?type=admin
import fetch from 'node-fetch';
async function run() {
const query = new URLSearchParams({
type: '<TYPE>', // Event type. One of cis, admin, risk, verify
}).toString();
const resp = await fetch(
`https://api.transmitsecurity.io/activities/v1/activities/start-collect?${query}`,
{
method: 'PUT',
headers: {
Authorization: 'Bearer <YOUR_TOKEN_HERE>' // Client access token
}
}
);
const data = await resp.text();
console.log(data);
}
run();
- Create an event stream. Make sure to provide a ID to identify the stream. The stream ID should be a continuous string, without spaces, and unique for each stream.
import fetch from 'node-fetch';
async function run() {
const query = new URLSearchParams({
type: '<TYPE>', // Event type. One of cis, admin, risk, verify
stream_id: 'string' // Unique stream ID, without spaces
}).toString();
const resp = await fetch(
`https://api.transmitsecurity.io/activities/v1/activities/stream?${query}`,
{
method: 'PUT',
headers: {
Authorization: 'Bearer <YOUR_TOKEN_HERE>' // Client access token
}
}
);
const data = await resp.text();
console.log(data);
}
run();
Step 3: Install the plugin
You have the following options:
- Install the plugin directly from Splunk portal . This option supports both Splunk Enterprise and Splunk Cloud environments.
- Download the plugin and install it manually. This option only supports Splunk Enterprise environments and doesn't work for Splunk Cloud users.
To install the plugin from Splunk portal:
- While logged in, go to Apps > Manage Apps , then click Browse more apps :
- Search for Mosaic Events Add-on:
- Click Install on the Mosaic Events Add-on tile.
- Log in with your Splunk username and password:
- Restart Splunk.
To install the plugin manually (only in Splunk Enterprise environments):
- Download Mosaic Audit Log Connector for Splunk .
- On Splunk portal, go to Apps > Manage Apps :
- Click Install App from File :
- Upload the file you've downloaded from Splunkbase:
After installation, the browser redirects you to the Apps page. This page now shows Mosaic on the app list.
Step 4: Configure the inputs
Now you need to launch the app and configure inputs for each stream you've created individually:
- Launch the app from the Apps page.
- Click Create New Input :
-
Configure inputs:
-
Name
: Give the input a meaningful name, for example,
Transmit_User_Events
. - Interval : Enter polling interval in seconds.
-
Index
: Use your preferred index; for example, you can choose
default
ormain
. -
OAuth Endpoint
: Token exchange endpoint:
https://api.transmitsecurity.io/oidc/token
(useapi.eu.transmitsecurity.io
for the EU andapi.ca.transmitsecurity.io
for Canada). -
Endpoint
: Use the following endpoint where
{TYPE}
and{STREAM_ID}
are parameters configured in Step 2 :https://api.transmitsecurity.io/activities/v1/activities/collect?type={TYPE}&stream_id={ID}
(useapi.eu.transmitsecurity.io
for the EU andapi.ca.transmitsecurity.io
for Canada). - Client ID and Client Secret : Use the values from the Management App you've created in the Mosaic portal earlier.
-
Name
: Give the input a meaningful name, for example,
Note
When defining the polling interval, consider the level of activity on the platform. For instance, you may want to use a longer polling interval, like 3600
(1 hour), for low traffic or a shorter interval, like 300
(5 minutes), for high-traffic situations.
Step 5. Check the operation
Check how the connector works using the Search app. Include sourcetype=transmit
in the search bar. If the search isn't working, restart Splunk.