Use this guide to forward Cloud Secure Edge (CSE) events into your ELK (Elasticsearch, Logstash, Kibana) stack for centralized monitoring and troubleshooting. CSE emits detailed security and policy events through the CSE Events API. Using our Filebeat integration, you can:
Following the outlined steps, you’ll create an API key in CSE, configure Filebeat using the API key, and validate that CSE events appear in Kibana.
filebeat.yml1.1 In the Command Center, navigate from Settings > API Keys.
1.2 Add a new API Key and configure the following details:
Filebeat IntegrationReadOnly-Events-to-the-ELK-Stack-kA1VN0000000XSD0A2-filebeat-api-key.png)
Copy and save the generated API Secret securely; you’ll use it in Step 2.
-Events-to-the-ELK-Stack-kA1VN0000000XSD0A2-api-secret.png)
2.1 Log into your Filebeat server.
2.2 Run the following command in your CLI:
filebeat keystore create
2.3 Run the following command in your CLI:
filebeat keystore add <CSE_API_KEY> # Replace <CSE_API_KEY> with your API key name
2.4 When prompted, paste the API key Secret (saved from Step 1) in the CLI.
3.1 Enter the following into the filebeat.inputs section:
- type: httpjson
config_version: 2
interval: 1m
request.url: 'https://net.banyanops.com/api/v1/events'
request.transforms:
- set:
target: header.Authorization
value: 'Bearer ${CSE_API_KEY}' # Uses keystore variable
- append:
target: url.params.after
value: '[[ .cursor.last_created_at ]]'
default: '[[ (now (parseDuration "-5m")).UnixMilli ]]'
- append:
target: url.params.order
value: 'ASC'
- append:
target: url.params.severity
value: 'INFO'
- append:
target: url.params.limit
value: '1000'
response.split:
target: body.data
cursor:
last_created_at:
value: '[[ printf "%d" (add (toInt (index .last_event "created_at")) 1) ]]'
fields_under_root: true
fields:
event.dataset: cse
3.2 Save your changes.
3.3 Restart Filebeat:
sudo systemcl restart filebeat
Note: For more information on how to start Filebeat on each platform type, visit here.
4.1 Run a quick query in Elasticsearch to confirm events are flowing in:
curl -s "http://localhost:9200/filebeat-*/_search?q=event.dataset"cse&size=1&pretty"
4.2 In Kibana, search for event.dataset:cse to view and filter CSE events.
The filebeat.yml file contains editable fields. Some of these fields are described below:
| Filebeat.yml Key Value Pair | Note |
|---|---|
type: httpjson | Our API for event logs returns JSON format. |
interval: 1m | We recommend setting the interval to once per minute to avoid exceeding the API rate limit. |
value: 'Bearer ${CSE_API_KEY} | CSE_API_KEY is the Name of the key stored in Step 1. We recommend entering the key into a secure space (i.e., Filebeat keystore) rather than entering the plain text of the key in the filebeat.yaml file. |
value: '[[ .cursor.last_created_at ]]' | Using our last_created_at value in the events JSON will provide the last time the events database consumed data. |
default: '[[ (now (parseDuration "-5m")).UnixMilli ]]' | If the last_created_at field is unavailable (most often occurs during the first launch of integration), we recommend obtaining only the last 5 minutes of data, so that you don’t exceed the request size limit. |
event.dataset: cse | We recommend calling the events something specific for easy searching and filtering (e.g., ‘cse’). |