Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit b5ffcb5

Browse files
JeffNaef-Trigermeshantoineco
authored andcommitted
Add documentation for the Elasticsearch target
Co-authored-by: Antoine Cotten <[email protected]>
1 parent 2545a56 commit b5ffcb5

File tree

4 files changed

+36
-56
lines changed

4 files changed

+36
-56
lines changed
178 KB
Loading
99.9 KB
Loading

docs/targets/elasticsearch.md

Lines changed: 32 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,54 @@
1-
# Event target for Elasticsearch
1+
# Event Target for Elasticsearch
22

3-
This event target receives [CloudEvents][ce] over HTTP and index their payload intoElasticsearch.
3+
This event Target receives [CloudEvents][ce] over HTTP and writes their payload to an [Elasticsearch][es] index.
44

55
## Prerequisites
66

7-
A Elasticsearch cluster and a set of credentials for indexing documents.
7+
1. If there is no pre-existing Elasticsearch cluster available, get started quickly by using either [Elastic Cloud on Kubernetes][eck] or [Elastic Cloud][elasticcloud].
88

9-
You can get started by using:
9+
1. Retrieve credentials for the Elasticsearch cluster in either of the following forms:
10+
* User and password
11+
* API Key
1012

11-
- [Elastic Cloud on Kubernetes][eck]
12-
- [Elascic Cloud][elasticcloud]
13+
Consult the [Elasticsearch documentation][docs] for more information on Elasticsearch.
1314

14-
## Create the Elasticsearch target integration
15+
## Deploying an Instance of the Target
1516

16-
Create the Elasticsearch target integration in 2 steps:
17+
Open the Bridge creation screen and add a Target of type `Elasticsearch`.
1718

18-
1. Retrieve credentials for Elasticsearch.
19-
2. Create the Elasticsearch target.
19+
![Adding a Elasticsearch Target](../images/elasticsearch-target/create-bridge-1.png)
2020

21-
### Elasticsearch credentials
21+
In the Target creation form, give a name to the event Target and add the following information:
2222

23-
Credentials for Elasticsearch which could be in the form:
23+
* **Index** : Name of the index to write documents to.
24+
* **Addresses** : List of URLs of Elasticsearch servers.
25+
* **Skip verify** : Allow skipping the server certificate verification.
26+
* **CA certificate** : CA certificate to be used by the event target's client, in PEM format.
27+
* **Username**: Elasticsearch username.
28+
* **Password**: Reference a [TriggerMesh secret][tm-secret] containing a password to communicate with the Elasticsearch API, as described in the previous section.
29+
* **API key**: Reference a [TriggerMesh secret][tm-secret] containing an API token to communicate with the Elasticsearch API, as described in the previous section.
2430

25-
- User and password to the Elasticsearch cluster.
26-
- An APIKey instead of User and password.
31+
When using a self-signed certificate you will need to either inform the **CA certificate** or set the **Skip verify** field.
2732

28-
Additionaly when using a self signed certificate you will need to either inform the `CACertificate` or set the `SkipVerify` field.
33+
![Elastic target form](../images/elasticsearch-target/create-bridge-2.png)
2934

30-
### Deploy Elasticsearch target
35+
After clicking the `Save` button, the console will self-navigate to the Bridge editor. Proceed by adding the remaining components to the Bridge.
3136

32-
At Triggermesh add a new secret depending on the credentials set:
37+
After submitting the Bridge, and allowing some configuration time, a green check mark on the main _Bridges_ page indicates that the Bridge with an Elasticsearch event Target was successfully created.
3338

34-
- For username and password create a secret that contain a `password` key.
35-
- For API key create a secret that contain a `key` key.
39+
![Bridge status](../images/bridge-status-green.png)
3640

37-
Then create a bridge that includes a Elasticsearch target:
41+
For more information about using Elasticsearch, please refer to the [Elasticsearch documentation][docs].
3842

39-
- `Name` is an internal identifier inside the bridge.
40-
- `Index` is the Elasticsearch index where documents will be indexed.
41-
- `Addresses` server address list.
42-
- `Skip verify` for skipping server certificate verification.
43-
- `CA certificate` is the Base64 encoding of the CA certificate for the server.
43+
## Event Types
4444

45-
Credential fields can be provided either through username and password, or API key:
45+
The Elasticsearch event target can consume events of any type.
4646

47-
- `Username` is the username for connecting.
48-
- `Password` secret with `password` key.
49-
50-
51-
- `APÎ Key` secret with `key`.
52-
53-
54-
## Events
55-
56-
Elasticsearch Target will forward any JSON payload at the CloudEvent to be indexed. There is no requirement nor filters on the cloud events fields, the only requirement is that the payload data is a valid JSON.
57-
58-
It would be desirable that the JSON conforms to the index mapping at elasticsearch.
59-
60-
### Example
61-
62-
```console
63-
curl -v http://elasticsearchtarget \
64-
-X POST \
65-
-H "Content-Type: application/json" \
66-
-H "Ce-Specversion: 1.0" \
67-
-H "Ce-Type: my.data.type" \
68-
-H "Ce-Source: some.origin/intance" \
69-
-H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79" \
70-
-d '{"message":"thanks for indexing this message","from": "Triggermesh targets", "some_number": 12}'
71-
```
47+
[eck]: https://github.com/elastic/cloud-on-k8s
48+
[elasticcloud]: https://www.elastic.co/cloud/
49+
[es]:https://www.elastic.co/elasticsearch/
50+
[docs]:https://www.elastic.co/guide/index.html
7251

7352
[ce]: https://cloudevents.io
74-
[eck]: https://github.com/elastic/cloud-on-k8s
75-
[elasticcloud]: https://www.elastic.co/cloud/
53+
54+
[tm-secret]: ../guides/secrets.md

docs/targets/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# Event targets
1+
# Event Targets
22

33
The following is a list of Triggermesh event Destinations known as Targets. Some are available as open source projects some are available as hosted solutions on our Cloud.
44

5-
## Current TriggerMesh Targets
5+
## Current TriggerMesh Targets
66

77
* [AWS](./aws.md): Forward events to AWS services such as Lambda, SNS, SQS, and Kinesis.
88
* [AWS EventBridge](./awseventbridge.md): Forward arbitrary events to AWS EventBridge.
99
* [Elasticsearch](./elasticsearch.md): Send events to Elasticsarch to be indexed.
1010
* [Oracle](./oracle.md): Forward events to the Oracle Cloud.
1111
* [Slack](./slack.md): Forward events to Slack as messages to deliver immediately, scheduled, or as an update to a pre-existing message.
12-
* [Splunk](./splunk.md): Forward arbitrary events to Splunk
12+
* [Splunk](./splunk.md): Forward arbitrary events to Splunk.
1313
* [Zendesk](./zendesk.md): Perform actions in Zendesk upon reception of certain events.
14+
* [Elasticsearch](./elasticsearch.md): Forward events to Elasticsearch.

0 commit comments

Comments
 (0)