Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds put request to update otel logs component template #112

Open
wants to merge 1 commit into
base: rca_ingress_obs
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"template": {
"mappings": {
"properties": {
"body_text": {
"type": "match_only_text"
},
"message": {
"type": "alias",
"path": "body_text"
}
}
}
}
}
11 changes: 8 additions & 3 deletions scripts/rca-demo/post-setup
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ create_rule 9055220c-8fb1-4f9f-be7c-0a33eb2bafc5 rule-01.json
echo -e "\n"

# Update mappings in ES
# NOTE: this will fail if the data stream is not created
# TODO: Update the component template also, and just swallow errors on this call
title "Attempting to add message alias for otel logs"

# NOTE: this one will fail if the data stream is not created yet, that's ok
title "Attempting to add message alias for otel logs index"
curl -X PUT "$OTEL_DEMO_ES_ENDPOINT/logs-*otel*/_mapping" -H "Authorization: ApiKey $OTEL_DEMO_ES_API_KEY" -H "Content-Type: application/json" -d @$SCRIPTS_DIR/data/mapping-message-alias.json

echo -e "\n"

title "Attempting to add message alias for logs-otel@mappings component template"
curl -X PUT "$OTEL_DEMO_ES_ENDPOINT/_component_template/logs-otel@mappings" -H "Authorization: ApiKey $OTEL_DEMO_ES_API_KEY" -H "Content-Type: application/json" -d @$SCRIPTS_DIR/data/mapping-component-template-message-alias.json

echo -e "\n"

# Enable EEM
title "Attempting to enable EEM"
curl -X PUT -u "$KIBANA_USER:$KIBANA_PASSWORD" -H "kbn-xsrf: bananas" -H "x-elastic-internal-origin: Kibana" $KIBANA_URL/internal/entities/managed/enablement
Loading