Forwarding Logs to Splunk Cloud
This guide covers configuring App Builder to forward application logs to a Splunk Cloud account.
Prerequisites
- An index on your Splunk Cloud account. Create a new index following Splunk's guide
- Local development setup for your App Builder application
- The latest version of AIO CLI. Check by running
aio --version
; update by runningnpm install -g @adobe/aio-cli
Steps to configure log forwarding
1. Set up Splunk HTTP event collector
On your Splunk Cloud account homepage, select
Settings
from the ribbon andData Inputs
on the Settings paneClick the
+ Add New
button corresponding to the HTTP Event Collector input typeOn the Select Source screen:
- Type in an input name, for example:
My App Builder Application
- Make sure the
Enable Indexer Acknowledgment
checkbox is not ticked - Click the
Next
button on top
- Type in an input name, for example:
On the Input Settings screen:
- Set the source type to
automatic
. Forwarded logs will be sent with thesourcetype
field set to_json
- From the list of indexes, select only the index on which you wish to receive logs from your App Builder application
- Click the
Review
button on top.
- Set the source type to
On the Done screen:
- Copy the token value for later use.
2. Get your Splunk hostname and port
To find your
hostname
andport
number, follow the procedures in Send Data to HTTP Event Collector on Splunk Cloud Platform from Splunk documentation.Confirm your
hostname
andport
number by executing this cURL request, using the token saved when you set up the Splunk HTTP event collector:Copied to your clipboardcurl -X POST 'https://<hostname>:<port>/services/collector' \-H "Authorization: Splunk <token>" \-d '{"event": "hello world"}'A
200 OK
response confirms yourhostname
andport
. Note that I/O Runtime supports only ports443
and8088
for port forwarding.
3. Set up log forwarding in App Builder
Open Terminal and navigate to the App Builder project directory on your local machine.
Run this command, supplying the values from previous steps:
Copied to your clipboardaio app config set log-forwarding? select log forwarding destination: Splunk HEC? host: <hostname>? port: <port_number>? index: <index>? hec_token: <token>Note:
- Be sure not to prefix the protocol (
http://
orhttps://
) before the hostname - Use the
hostname
andport
as determined in "Getting Splunk host and port" above - Use the
token
value token saved when you set up the Splunk HTTP event collector
- Be sure not to prefix the protocol (
Verify that the configuration change has taken place:
Copied to your clipboardaio app config get log-forwarding
Execute an action in your App Builder application workspace to generate logs.
Go to Splunk Home > Search and run the query:
Copied to your clipboardindex=<index>
- If you don't see any logs in Splunk, check for log forwarding errors:
Copied to your clipboardaio app config get log-forwarding errors
Next steps
If you are unable to set up log forwarding using these procedures, please visit Adobe Experience Leage App Builder Community for support.
Proceed to Forwarding logs to Splunk Enterprise.
Return to Managing Application Logs.
Return to Guides Index.