Splunk for Mendix Cloud
Introduction
Splunk Cloud Platform is a monitoring and analysis tool for cloud applications. This document explains how to configure your Mendix Cloud app to send the runtime application logs to Splunk Cloud Platform to provide additional search, analysis, and visualization of your runtime application logs.
Mendix provides integration with Splunk Cloud Platform; it does not currently integrate with other Splunk monitoring products. Mendix sends only the runtime application logs to Splunk.
Prerequisites
To use the Splunk Cloud Platform and send data to Splunk Cloud Platform from your Mendix app, you need the following:
- Access to Splunk Cloud Platform
- An access token for your Splunk Cloud Platform account, obtained from the Splunk Cloud Platform dashboard
- A licensed Mendix app of which you are the Technical Contact
Connecting Your Node to Splunk Cloud Platform
Set up Splunk Integration on the Mendix Portal
To send your runtime information to Splunk Cloud Platform, you need to set it up using environment variables in the Mendix Portal.
-
From Apps, go to the Environments page of your app.
-
Click Details on the environment you wish to monitor with Splunk Cloud Platform.
-
Switch to the Runtime tab.
-
Add the following Custom Environment Variables.
Variable Description Default SPLUNK_HOST
The hostname or the IP address of the Splunk Cloud Platform Controller without the scheme (protocol). An example is test.splunkcloud.com
.SPLUNK_PORT
The HTTP (or HTTPS) port of the Splunk Cloud Platform Controller. 8088
SPLUNK_TOKEN
An access token to the Splunk Cloud Platform. To create a new token on the Splunk Cloud dashboard, open the Splunk Cloud dashboard in a browser, go to Settings > Data Input > HTTP Event Collector, and click New Token (on the upper-right corner of the page). LOGS_REDACTION
Email addresses are automatically redacted before log entries are sent to Splunk Cloud Platform. To disable this redaction, set LOGS_REDACTION
tofalse
. The environment variableSPLUNK_LOGS_REDACTION
is still supported, but it is now deprecated and will be removed in a later version. Its use is not recommended.true
-
Return to the Environments page for your app and Deploy or Transport your app into the selected environment.
The first time you set up the Splunk Cloud Platform integration, you must redeploy your app and then restart it. Just restarting the app is not sufficient because additional dependencies need to be included.
Metadata
In addition to the runtime application logs, the following JSON-formatted metadata is automatically sent to the Splunk Cloud Platform:
environment_id
– unique identifier of the environmentinstance_index
– number of the application instancehostname
– name of the application hostapplication_name
– default application name, retrieved from domain namemodel_version
– model version of the Mendix runtimeruntime_version
– version of the Mendix runtime
You can filter the data by these fields.
Custom tags
You can also set up custom tags in the format key:value
. Mendix recommends adding the following custom tags:
app:{app_name}
(for example,app:customermanagement
) – this enables you to identify all logs sent from your appenv:{environment_name}
(for example,env:accp
) – this enables you to identify logs sent from a particular environment so you can separate out production logs from test logs
To set these tags, do the following:
- From Apps, go to the Environments page of your app.
- Click Details on an environment you are monitoring with Splunk.
- Switch to the Tags tab.
- Click Add and type in the string to be sent to Splunk as a tag.
- Restart the app.
Additional Information
Location of Logs
Once the Mendix application is redeployed and restarted, the runtime application logs will appear on Splunk Cloud Platform under Search & Reporting.
In the search line, specify source="http:your_token_name"
and click the search button.
Splunk Cloud Platform Issues
If you have any issues related to accessing Splunk Cloud Platform, contact their support using the links on the Splunk Cloud Platform site. You will need a Splunk Cloud Platform account to request support.