Skip to content

Commit

Permalink
[Logs Onboarding] Adds install shipper step for custom logs (#157802)
Browse files Browse the repository at this point in the history
Closes #154937

This PR includes the steps to install standalone elastic agent +
reporting the status from bash script back to kibana.

![Screenshot 2023-05-15 at 5 02 29
PM](https://github.com/elastic/kibana/assets/1967266/62484fb3-e02f-410d-aa7a-86bcc4dc0b03)

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Yngrid Coello <[email protected]>
Co-authored-by: Yngrid Coello <[email protected]>
  • Loading branch information
4 people authored May 23, 2023
1 parent 9e01dc8 commit 12401b2
Show file tree
Hide file tree
Showing 24 changed files with 896 additions and 157 deletions.
12 changes: 12 additions & 0 deletions packages/kbn-check-mappings-update-cli/current_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,18 @@
}
}
},
"observability-onboarding-state": {
"properties": {
"state": {
"type": "object",
"dynamic": false
},
"progress": {
"type": "object",
"dynamic": false
}
}
},
"ml-job": {
"properties": {
"job_id": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"ml-module": "c88b6a012cfb7b7adb7629b1edeab6b83f1fd048",
"ml-trained-model": "49a1685d79990ad05ea1d1d30e28456fe002f3b9",
"monitoring-telemetry": "24f7393dfacb6c7b0f7ad7d242171a1c29feaa48",
"observability-onboarding-state": "9a55f01199158a68ea8a0123e99ff092cdcdb71c",
"osquery-manager-usage-metric": "23a8f08a98dd0f58ab4e559daa35b06edc40ed4f",
"osquery-pack": "edd84b2c59ef36214ece0676706da8f22175c660",
"osquery-pack-asset": "18e08979d46ee7e5538f54c080aec4d8c58516ca",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ describe('split .kibana index into multiple system indices', () => {
"ml-module",
"ml-trained-model",
"monitoring-telemetry",
"observability-onboarding-state",
"osquery-manager-usage-metric",
"osquery-pack",
"osquery-pack-asset",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const previouslyRegisteredTypes = [
'ml-module',
'ml-telemetry',
'monitoring-telemetry',
'observability-onboarding-state',
'osquery-pack',
'osquery-pack-asset',
'osquery-saved-query',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

API_KEY_ENCODED=$1
API_ENDPOINT=$2

updateStepProgress() {
echo " GET $API_ENDPOINT/step/$1?status=$2"
curl --request GET \
--url "$API_ENDPOINT/step/$1?status=$2" \
--header "Authorization: ApiKey $API_KEY_ENCODED" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true"
echo ""
}

echo "Downloading Elastic Agent"
# https://www.elastic.co/guide/en/fleet/8.7/install-standalone-elastic-agent.html
curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.7.1-linux-x86_64.tar.gz
updateStepProgress "ea-download" "success"
echo "Extracting Elastic Agent"
tar xzvf elastic-agent-8.7.1-linux-x86_64.tar.gz
updateStepProgress "ea-extract" "success"
echo "Installing Elastic Agent"
cd elastic-agent-8.7.1-linux-x86_64
./elastic-agent install -f
updateStepProgress "ea-install" "success"
echo "Sending status to Kibana..."
updateStepProgress "ea-status" "active"
Loading

0 comments on commit 12401b2

Please sign in to comment.