### Install Project Dependencies Source: https://www.elastic.co/docs/contribute-docs/api-docs/elasticsearch-api-docs-quickstart Run 'make setup' to install all necessary dependencies and tools. This command should be executed every time you start a new contribution to ensure you have the latest setup. ```shell make setup ``` -------------------------------- ### Install, Configure, and Start EDOT Node.js Source: https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/node/setup Perform the minimal setup steps for EDOT Node.js: install the package, set environment variables for configuration, and start your application with the Node.js runtime. ```bash # Install it npm install --save @elastic/opentelemetry-node # Configure it export OTEL_EXPORTER_OTLP_ENDPOINT="...your-ELASTIC_OTLP_ENDPOINT..." export OTEL_EXPORTER_OTLP_HEADERS="Authorization=ApiKey ...your-ELASTIC_API_KEY..." export OTEL_SERVICE_NAME="my-app" # Start it with your application node --import @elastic/opentelemetry-node my-app.js ``` -------------------------------- ### Complete Go Application Installation and Run Source: https://www.elastic.co/docs/reference/elasticsearch/clients/go/installation.md This snippet demonstrates a complete setup for a Go application, including initializing a module, getting the client, creating a main file, and running the application. ```shell mkdir my-elasticsearch-app && cd my-elasticsearch-app && go mod init my-elasticsearch-app go get github.com/elastic/go-elasticsearch/v9@v9.4.1 cat > main.go <<-END package main import ( "context" "log" "github.com/elastic/go-elasticsearch/v9" ) func main() { es, _ := elasticsearch.NewTyped() defer es.Close(context.Background()) log.Println(elasticsearch.Version) log.Println(es.Info().Do(context.Background())) } END go run main.go ``` -------------------------------- ### Set Up Node.js Environment Source: https://www.elastic.co/docs/contribute-docs/api-docs/elasticsearch-api-docs-quickstart Use the specified Node.js version for your environment. Refer to the setup guide if Node.js is not installed. ```shell nvm use ``` -------------------------------- ### Example Helm Install Command with Actual Values Source: https://www.elastic.co/docs/reference/fleet/example-kubernetes-fleet-managed-agent-helm.md An example of the `helm install` command with specific Fleet URL and token values, demonstrating a complete installation configuration for Fleet-managed Elastic Agent. ```sh helm install demo elastic/elastic-agent \ --set agent.fleet.enabled=true \ --set system.enabled=true \ --set agent.fleet.url=https://256575858845283fxxxxxxxd5265d2b4.fleet.us-central1.gcp.foundit.no:443 \ --set agent.fleet.token=eSVvFDUvSUNPFldFdhhZNFwvS5xxxxxxxxxxxxFEWB1eFF1YedUQ1NWFXwr== \ --set agent.fleet.preset=perNode ``` -------------------------------- ### Example Helm Install Command with Specific Values Source: https://www.elastic.co/docs/reference/fleet/example-kubernetes-standalone-agent-helm.md An example of the `helm install` command with concrete values for the Elasticsearch endpoint and API key, demonstrating a typical configuration. ```sh helm install demo elastic/elastic-agent \ --set kubernetes.enabled=true \ --set system.enabled=true \ --set outputs.default.type=ESPlainAuthAPI \ --set outputs.default.url=https://demo.es.us-central1.gcp.foundit.no:443 \ --set outputs.default.api_key="A6ecaHNTJUFFcJI6esf4:5HJPxxxxxxxPS4KwSBeVEs" ``` -------------------------------- ### View Metricbeat Setup Help Source: https://www.elastic.co/docs/extend/beats/import-dashboards.md Access the command-line help for the `setup` command to understand its available flags and options for initial environment setup. ```shell ./metricbeat help setup ``` -------------------------------- ### Install Plugins using Init Container in ECK Source: https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s/custom-configuration-files-plugins.md Use an init container to install Elasticsearch plugins before the main Elasticsearch container starts. This example installs the 'repository-azure' plugin. ```yaml spec: nodeSets: - name: default count: 3 podTemplate: spec: initContainers: - name: install-plugins command: - sh - -c - | bin/elasticsearch-plugin remove --purge repository-azure bin/elasticsearch-plugin install --batch repository-azure ``` -------------------------------- ### Set up and start Filebeat Source: https://www.elastic.co/docs/manage-data/ingest/ingesting-data-from-applications/ingest-logs-from-nodejs-web-application-using-filebeat.md Load predefined assets and start Filebeat from the installation directory. Use `--strict.perms=false` if permission issues arise. ```bash ./filebeat setup -e ./filebeat -e ``` ```bash ./filebeat -e --strict.perms=false ``` -------------------------------- ### Install Elasticsearch and Kibana with Default Values Source: https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s/managing-deployments-using-helm-chart.md Installs an ECK-managed Elasticsearch and Kibana using the default Helm chart values. This is suitable for quickstart examples and basic deployments. ```sh # Install an eck-managed Elasticsearch and Kibana using the default values, which deploys the quickstart examples. helm install es-kb-quickstart elastic/eck-stack -n elastic-stack --create-namespace ``` -------------------------------- ### Run Metricbeat Setup Command Source: https://www.elastic.co/docs/extend/beats/import-dashboards.md Execute the `setup` command to import all default dashboards, index mappings, ingest pipelines, and ILM policies for Metricbeat. ```shell ./metricbeat setup ``` -------------------------------- ### Download Example Heartbeat Configuration Source: https://www.elastic.co/docs/reference/beats/heartbeat/running-on-docker.md Download a sample Heartbeat configuration file to use as a starting point for your Docker setup. ```sh curl -L -O https://raw.githubusercontent.com/elastic/beats/9.4/deploy/docker/heartbeat.docker.yml ``` -------------------------------- ### Launch Filebeat Source: https://www.elastic.co/docs/manage-data/ingest/ingesting-data-from-applications/ingest-logs-from-nodejs-web-application-using-filebeat.md Start Filebeat from its installation directory. The `-e` flag directs output to standard error for easier monitoring during setup. ```bash ./filebeat -e ``` -------------------------------- ### Install Project Dependencies Source: https://www.elastic.co/docs/reference/search-ui/tutorials-elasticsearch-install-connector Navigate to the root of the downloaded starter app and install its dependencies using Yarn. ```shell yarn ``` -------------------------------- ### Get Privileged Access Detection Package Status Source: https://www.elastic.co/docs/api/doc/kibana/operation/operation-getprivilegedaccessdetectionpackagestatus Retrieves the installation and ML module setup status of the privileged access detection package, along with the state of each associated ML job. ```APIDOC ## GET /api/entity_analytics/privileged_user_monitoring/pad/status ### Description Returns the installation and ML module setup status of the privileged access detection package, along with the state of each associated ML job. ### Method GET ### Endpoint /api/entity_analytics/privileged_user_monitoring/pad/status ### Parameters ### Responses #### 200 Privileged access detection status retrieved #### Body: application/json (object) - **jobs** (array[object]) - Description not available - **ml_module_setup_status** (string) - Description not available - **package_installation_status** (string) - Description not available ``` -------------------------------- ### Install EDOT .NET on Windows (PowerShell) Source: https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/dotnet/setup/zero-code Use PowerShell to download and import the module, install core files (online or offline), and register instrumentation for the current session. Then, run your application. ```powershell # PowerShell 5.1 or higher is required # Download the module $module_url = "https://github.com/elastic/elastic-otel-dotnet/releases/latest/download/Elastic.OpenTelemetry.DotNet.psm1" $download_path = Join-Path $env:temp "Elastic.OpenTelemetry.DotNet.psm1" Invoke-WebRequest -Uri $module_url -OutFile $download_path -UseBasicParsing # Import the module to use its functions Import-Module $download_path # Install core files (online vs offline method) Install-OpenTelemetryCore Install-OpenTelemetryCore -LocalPath "C:\Path\To\OpenTelemetry.zip" # Set up the instrumentation for the current PowerShell session Register-OpenTelemetryForCurrentSession -OTelServiceName "MyServiceDisplayName" # Run your application with instrumentation . MyNetApp.exe ``` -------------------------------- ### Get Existing ECE Server Certificate Chain Source: https://www.elastic.co/docs/deploy-manage/security/secure-your-elastic-cloud-enterprise-installation/manage-security-certificates.md Use the openssl command-line tool to display the entire server certificate chain for your ECE installation. Connect to the Cloud UI URL provided during setup. ```sh openssl s_client -showcerts -connect 192.168.43.10:12343 < /dev/zero CONNECTED(00000003) depth=2 CN = elastic ce master verify error:num=19:self signed certificate in certificate chain --- Certificate chain 0 s:/CN=elastic ce admin console a954e2668da4 i:/CN=elastic ce admin console root -----BEGIN CERTIFICATE----- MIIDjzCCAnegAwIBAgIGAVqk1eYJMA0GCSqGSIb3DQEBCwUAMCgxJjAkBgNVBAMT HWeWlas0IGNlIGFkbWluIGNvbnNvbGUgcm9vdDB4XDTE3MDMwNjE4MTYwNVc DTI3MDMwNDE4MTYwNVowMDEuMCwGA1UEAxMlZWxhc3RpYyBjZSBhZG1pbiBjb25z b2xlIGE5NTRlMjY2OGRhNDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB ALqsQZexkEWoOnhK5uDrGC4kjEWVSWoYOR6ymd8ySHIqhqAZTGoRhiO46jlrCr+e Jqn3a+qlNNCmEBc5BqjDlKpEKmaLQJoAZock2fOXLiKVQZiJK+ygShoMq2KGpIeY m/gzQ01atAuETBut8AgpjMN2/xbm3FI0KiqPEpglC8wKQ4hKukbVn5YJBZmBjJxr 17vzhDpC/qJJ+owRNUoz9vd4VEfDjNhaZWJ8ihDWUCL9rDwVp8XVLUQ38SBurd7A zJjfzHfrpI9+C8F2UBHjDdqus253Qho5a8S+hGq7VRVqcGoo0nvqThVvR2s0tEDk fsN0rDOL3or9BwUbv0gIiAECAwEAAaOBtjCBszAsBgNVHREEJTAjggxlY2UtMC1y 1W5uZXKCDTE5Mi4xNjguNDMuMTCHBMCoKwowSQYDVR0jBEIwQIAUgB4X3GsrUoGz SzJ4IQ8nuB6cosOhIKQeMBwxGjAYBgNVBAMTEWVsYXN0aWMgY2UgbWFzdGVyggYB WqTVH5EwHQYDVR0OBBYEFA7euGA6jC4XSKCRNt1ZWqABUa/EMAkGA1UdEwQCMAAw DgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3DQEBCwUAA4IBAQA9xskIXZ8byN0I+M/R cXKbvVzsu//gVgswCSZ/KpidWZnSxhuQ4tIryby6DqTKSvzp17ASld1VrYp3vZw+ zIgU7k7f/w2ATnm39Sn/DxuKUGEblMjUs2X9cF+ijFZklgX1LyWwIK9iKCATuS7J OThTFGuV0NScsvhiFTTaCXteQql+WwFOI2vL5XZKE8XiQesDiJfNbWg2K/EhxBih sFPWgik9aljciAHXK/pH9vQNf2rfpSL9HSTc89RetDFkmkXGIPKd3lxORE6wCdKm mUi6uktMCnBSyMapNEbiWR3sAPf30y81UAVJKcnzd7r8bP3V/19ZBEfvEUS80DT th3x -----END CERTIFICATE----- 1 s:/CN=elastic ce admin console root i:/CN=elastic ce master -----BEGIN CERTIFICATE----- MIIDUDCCAjigAwIBAgIGAVqk1R+RMA0GCSqGSIb3DQEBCwUAMBwxGjAYBgNVBAMT EWVsYXN0aWMgY2UgbWFzdGVyMB4XDTE3MDMwNjE4MTUxNVcXDTI3MDMwNDE4MTUx NVowKDEmMCQGA1UEAxMdZWxhc3RpYyBjZSBhZG1pbiBjb25zb2xlIHJvb3QwggEi MA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQCbse8n9LOSSnrBI6KSFieNZKKL MEjK+T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lowHDEaMBgGA1UEAxMRZWxhc3RpYyBjZSBtYXN0ZXIwggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQDbwOBtXjKvw4B10HDfoXatlXn8qUHkesV9+lWT0NT1 WU1X4rc9TwCsWHbH1S0YmOiTw9YVrzFjbYtjNgW5M3DXiewfvnfVm6ifrcuU1C0L yN8WxqBmvQt/7H2hyKwgsmiXfoULbT5PGuhizvRntlD2OgnPjshwetkRN//O3NWo Osd2LKMyzUvRPxNP2CwbQLetLgEpQjrjB+nfv4WZHkAQ4vGwxFkN6WaIpqhuhg2q I8xEHHh1IYTEOiQJZXXg7nU3vqY3kQ2Yu9kopuUJoXY5CviZLZO/xCriNVEPaOhX 6pWM+dDHaEzx1EiZNg3bjpAXAP+aErSDVAlqbYqCoeAvAgMBAAGjgYswgYgwHQYD VR0OBBYEFGXU+d77zCP1y1CmoXoVaCwOc+ERMEkGA1UdIwRCMECAFGXU+d77zCP1 y1CmoXoVaCwOc+ERoSCkHjAcMRowGAYDVQQDExFlbGFzdGljIGNlIG1hc3RlcoIG AVqk1RbSMAwGA1UdEwQFMAMBAf8wDgYDVR0PAQH/BAQDAgH2MA0GCSqGSIb3DQEB CwUAA4IBAQBclrkSxPRhN6uxPmJ4QIlZ8OOBKuPPul5434Au8UWAzQX8p6tKLBBT Zpl9py/fg8YS1iTlPBkRCjssZG9x3x0gG2ftDqrO4AqL7L0X3oZRy+sIkG17h3GI CcHO596EGzhFPSa183kIwGXb4mI5nNUe43KkDXEyid/VIn27jokeqslfu2KQJnC1 ggwLRgrNpeNO4pb7cK4aBu3oLZ0tPnhdbIG+bVgHE6a6ZYyBH266oJmNpqmNOTzn JjrgOt5gEB5JcL1VWXZ3lU3ukd5Jq/rGFkqytBj+uQccpuWkGUMqU82xjREES8D8 AIHl4ghc6SM1jl2SqZR7aoAjP0uGwW31 -----END CERTIFICATE----- --- Server certificate subject=/CN=elastic ce admin console a954e2668da4 issuer=/CN=elastic ce admin console root --- No client certificate CA names sent Peer signing digest: SHA512 Server Temp Key: ECDH, P-256, 256 bits --- ``` -------------------------------- ### Show All Catalogs with Output Example Source: https://www.elastic.co/docs/reference/query-languages/sql/sql-syntax-show-catalogs Demonstrates the SHOW CATALOGS command and provides an example of the expected output format, listing catalog names and their types. ```sql SHOW CATALOGS; name | type ------------------+--------------- javaRestTest |local my_remote_cluster |remote ``` -------------------------------- ### Solr Setup for Schemaless Mode Source: https://www.elastic.co/docs/reference/logstash/versioned-plugins/v3-0-2-plugins-outputs-solr_http This example demonstrates how to set up Solr in schemaless mode for quick integration with Logstash. It involves unpacking Solr, replacing the default configuration with a schemaless one, and starting the Solr server. ```bash tar zxf solr-4.4.0.tgz cd example mv solr solr_ #back up the existing sample conf cp -r example-schemaless/solr/ . java -jar start.jar #start Solr ``` -------------------------------- ### Create Data Directory Source: https://www.elastic.co/docs/reference/search-connectors/api-tutorial Creates a directory to store example datasets for the tutorial. ```sh mkdir -p ~/data ``` -------------------------------- ### Install EDOT .NET on Linux/macOS Source: https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/dotnet/setup/zero-code Download and run the .sh script to install core files, enable execution, and set up instrumentation for the current shell session. Then, run your application with the OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES environment variables. ```bash # Download the bash script curl -sSfL https://github.com/elastic/elastic-otel-dotnet/releases/latest/download/elastic-dotnet-auto-install.sh -O # Install core files sh ./elastic-dotnet-auto-install.sh # Enable execution for the instrumentation script chmod +x $HOME/.otel-dotnet-auto/instrument.sh # Setup the instrumentation for the current shell session . $HOME/.otel-dotnet-auto/instrument.sh # Run your application with instrumentation OTEL_SERVICE_NAME=myapp OTEL_RESOURCE_ATTRIBUTES=deployment.environment=staging,service.version=1.0.0 ./MyNetApp ``` -------------------------------- ### Get installed packages Source: https://www.elastic.co/docs/api/doc/kibana/group/endpoint-elastic-package-manager-epm Retrieves a list of all installed packages. ```APIDOC ## GET /api/fleet/epm/packages/installed ### Description Retrieves a list of all installed packages. ### Method GET ### Endpoint /api/fleet/epm/packages/installed ### Response #### Success Response (200) - **installed_packages** (array) - A list of installed packages. ``` -------------------------------- ### Install Vale for Linux Source: https://www.elastic.co/docs/contribute-docs/vale-linter Run this command to install Vale and the Elastic style guide on Linux. If Vale is not installed, this script will install it. ```bash curl -fsSL https://raw.githubusercontent.com/elastic/vale-rules/main/install-linux.sh | bash ``` -------------------------------- ### Install Plugin from HTTP URL Source: https://www.elastic.co/docs/reference/elasticsearch/plugins/plugin-management-custom-url.md Install a plugin from an HTTP URL. Replace `` with the actual host URL. ```shell sudo bin/elasticsearch-plugin install /plugin.zip ``` -------------------------------- ### Example of Deployment Applicability with applies_to Source: https://www.elastic.co/docs/contribute-docs/how-to/cumulative-docs/guidelines Shows how to specify applicability across different deployment types and products. The build system automatically orders these keys for consistent display. ```markdown ```{applies_to} deployment: ece: ga self: ga serverless: ga ``` ``` -------------------------------- ### Install Vale for macOS Source: https://www.elastic.co/docs/contribute-docs/vale-linter Run this command to install Vale and the Elastic style guide on macOS. If Vale is not installed, this script will install it. ```bash curl -fsSL https://raw.githubusercontent.com/elastic/vale-rules/main/install-macos.sh | bash ``` -------------------------------- ### Timestamped Log Event Example Source: https://www.elastic.co/docs/reference/beats/filebeat/multiline-examples.md This example shows a log event starting with a timestamp. The multiline configuration merges lines that do not start with the specified timestamp pattern. ```shell [2015-08-24 11:49:14,389][INFO ][env ] [Letha] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [34.5gb], net total_space [118.9gb], types [hfs] ``` ```yaml parsers: - multiline: type: pattern pattern: '^\[[0-9]{4}-[0-9]{2}-[0-9]{2}' negate: true match: after ``` ```yaml multiline.type: pattern multiline.pattern: '^[[0-9]{4}-[0-9]{2}-[0-9]{2}' multiline.negate: true multiline.match: after ``` -------------------------------- ### Help option for instance-configuration Source: https://www.elastic.co/docs/reference/ecctl/ecctl_platform_instance-configuration.md Displays help information for the instance-configuration command. ```bash -h, --help help for instance-configuration ``` -------------------------------- ### Setup Winlogbeat Assets Source: https://www.elastic.co/docs/reference/beats/winlogbeat/winlogbeat-installation-configuration.md Run this command from the installation directory to load the index template, ingest pipelines, and sample dashboards. ```powershell PS > .\winlogbeat.exe setup -e ``` -------------------------------- ### Start Filebeat Source: https://www.elastic.co/docs/manage-data/ingest/ingesting-data-from-applications/ingest-data-from-beats-to-elasticsearch-service-with-logstash-as-proxy.md Command to start the Filebeat service. Ensure you are in the Filebeat installation directory. ```txt ./filebeat -c filebeat.yml ``` -------------------------------- ### File Path Examples Source: https://www.elastic.co/docs/reference/elasticsearch/curator/configfile.md Illustrates how to specify file paths for Windows and Linux/BSD/Mac OS, recommending single-quotes. ```shell 'C:\path\to\file' ``` ```shell '/path/to/file' ``` -------------------------------- ### Start Metricbeat Source: https://www.elastic.co/docs/manage-data/ingest/ingesting-data-from-applications/ingest-data-from-beats-to-elasticsearch-service-with-logstash-as-proxy.md Command to start the Metricbeat service. Ensure you are in the Metricbeat installation directory. ```txt ./metricbeat -c metricbeat.yml ``` -------------------------------- ### Serve documentation locally on macOS/Linux Source: https://www.elastic.co/docs/contribute-docs/locally Starts a local server to preview documentation from a `docs` folder. Use `-p` to specify the `docset.yml` file path. ```sh docs-builder serve ``` -------------------------------- ### Timestamped Log Event Example Source: https://www.elastic.co/docs/reference/aws-forwarder/aws-elastic-serverless-forwarder-configuration.md Example of an activity log line starting with a timestamp. ```shell [2015-08-24 11:49:14,389][INFO ][env ] [Letha] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [34.5gb], net total_space [118.9gb], types [hfs] ``` -------------------------------- ### Create ES|QL SHOW command Source: https://www.elastic.co/docs/reference/elasticsearch/clients/python/esql-query-builder.md Demonstrates constructing the ES|QL SHOW command to retrieve deployment information. ```python from elasticsearch.esql import ESQL # SHOW INFO query = ESQL.show("INFO") ```