Skip to content

Commit

Permalink
Add standalone agent config file example: Nginx HTTP Server (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
kilfoyle authored Oct 27, 2023
1 parent 7d066b2 commit 88f6d97
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 10 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ inputs: <6>
- add_locale: null
----

<1> For available output settings, refer to <<elastic-agent-output-configuration>>.
<2> For settings specific to the {es} output, refer to <<elasticsearch-output>>.
<1> For available output settings, refer to <<elastic-agent-output-configuration,Configure outputs for standalone {agents}>>.
<2> For settings specific to the {es} output, refer to <<elasticsearch-output,Configure the {es} output>>.
<3> The URL of the Elasticsearch cluster where output should be sent, including the port number. For example `https://12345ab6789cd12345ab6789cd.us-central1.gcp.cloud.es.io:443`.
<4> For available download settings, refer to <<elastic-agent-standalone-download>>.
<5> For available monitoring settings, refer to <<elastic-agent-monitoring-configuration>>.
<6> For available input settings, refer to <<elastic-agent-input-configuration>>.
<4> For available download settings, refer to <<elastic-agent-standalone-download,Configure download settings for standalone Elastic Agent upgrades>>.
<5> For available monitoring settings, refer to <<elastic-agent-monitoring-configuration,Configure monitoring for standalone {agents}>>.
<6> For available input settings, refer to <<elastic-agent-input-configuration,Configure inputs for standalone {agents}>>.
<7> Specify a unique ID for the input.
<8> For available input types, refer to <<elastic-agent-inputs-list>>.
<9> Learn about <<data-streams>> for time series data.
Expand Down Expand Up @@ -118,12 +118,12 @@ inputs: <6>
server_status_path: /server-status
----

<1> For available output settings, refer to <<elastic-agent-output-configuration>>.
<2> For settings specific to the {es} output, refer to <<elasticsearch-output>>.
<1> For available output settings, refer to <<elastic-agent-output-configuration,Configure outputs for standalone {agents}>>.
<2> For settings specific to the {es} output, refer to <<elasticsearch-output,Configure the {es} output>>.
<3> The URL of the Elasticsearch cluster where output should be sent, including the port number. For example `https://12345ab6789cd12345ab6789cd.us-central1.gcp.cloud.es.io:443`.
<4> For available download settings, refer to <<elastic-agent-standalone-download>>.
<5> For available monitoring settings, refer to <<elastic-agent-monitoring-configuration>>.
<6> For available input settings, refer to <<elastic-agent-input-configuration>>.
<4> For available download settings, refer to <<elastic-agent-standalone-download,Configure download settings for standalone Elastic Agent upgrades>>.
<5> For available monitoring settings, refer to <<elastic-agent-monitoring-configuration,Configure monitoring for standalone {agents}>>.
<6> For available input settings, refer to <<elastic-agent-input-configuration,Configure inputs for standalone {agents}>>.
<7> For available input types, refer to <<elastic-agent-inputs-list>>.
<8> Learn about <<data-streams>> for time series data.
<9> Specify a unique ID for each individual input stream. Naming the ID by appending the associated `data_stream` dataset (for example `{user-defined-unique-id}-apache.status`) is a recommended practice, but any unique ID will work.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
[[config-file-example-nginx]]
= Config file example: Nginx HTTP Server

++++
<titleabbrev>Nginx HTTP Server</titleabbrev>
++++

Include these sample settings in your standalone {agent} `elastic-agent.yml` configuration file to ingest data from Nginx HTTP Server.

* <<config-file-example-nginx-logs>>
* <<config-file-example-nginx-metrics>>

[[config-file-example-nginx-logs]]
== Nginx HTTP Server logs

["source","yaml"]
----
outputs: <1>
default:
type: elasticsearch <2>
hosts:
- '{elasticsearch-host-url}' <3>
username: '${ES_USERNAME}'
password: '${ES_PASSWORD}'
agent:
download: <4>
sourceURI: 'https://artifacts.elastic.co/downloads/'
monitoring: <5>
enabled: true
use_output: default
namespace: default
logs: true
metrics: true
inputs: <6>
- id: "insert a unique identifier here" <7>
name: nginx-1
type: logfile <8>
use_output: default
data_stream: <9>
namespace: default
streams:
- id: "insert a unique identifier here" <10>
data_stream:
dataset: nginx.access <11>
type: logs
ignore_older: 72h
paths: <12>
- /var/log/nginx/access.log*
tags:
- nginx-access
exclude_files:
- .gz$
processors:
- add_locale: null
- id: "insert a unique identifier here" <10>
data_stream:
dataset: nginx.error <11>
type: logs
ignore_older: 72h
paths: <12>
- /var/log/nginx/error.log*
tags:
- nginx-error
exclude_files:
- .gz$
multiline:
pattern: '^\d{4}\/\d{2}\/\d{2} '
negate: true
match: after
processors:
- add_locale: null
----

<1> For available output settings, refer to <<elastic-agent-output-configuration,Configure outputs for standalone {agents}>>.
<2> For settings specific to the {es} output, refer to <<elasticsearch-output,Configure the {es} output>>.
<3> The URL of the Elasticsearch cluster where output should be sent, including the port number. For example `https://12345ab6789cd12345ab6789cd.us-central1.gcp.cloud.es.io:443`.
<4> For available download settings, refer to <<elastic-agent-standalone-download,Configure download settings for standalone Elastic Agent upgrades>>.
<5> For available monitoring settings, refer to <<elastic-agent-monitoring-configuration,Configure monitoring for standalone {agents}>>.
<6> For available input settings, refer to <<elastic-agent-input-configuration,Configure inputs for standalone {agents}>>.
<7> A user-defined ID to uniquely identify the input stream.
<8> For available input types, refer to <<elastic-agent-inputs-list>>.
<9> Learn about <<data-streams>> for time series data.
<10> Specify a unique ID for each individual input stream. Naming the ID by appending the associated `data_stream` dataset (for example `{user-defined-unique-id}-nginx.access` or `{user-defined-unique-id}-nginx.error`) is a recommended practice, but any unique ID will work.
<11> Refer to {integrations-docs}/nginx#logs-reference[Logs reference] in the Nginx HTTP integration documentation for the logs available to ingest and exported fields.
<12> Path to the log files to be monitored.

[discrete]
[[config-file-example-nginx-metrics]]
== Nginx HTTP Server metrics

["source","yaml"]
----
outputs: <1>
default:
type: elasticsearch <2>
hosts:
- '{elasticsearch-host-url}' <3>
username: '${ES_USERNAME}'
password: '${ES_PASSWORD}'
agent:
download: <4>
sourceURI: 'https://artifacts.elastic.co/downloads/'
monitoring: <5>
enabled: true
use_output: default
namespace: default
logs: true
metrics: true
inputs: <6>
- id: "insert a unique identifier here" <7>
type: nginx/metrics <8>
use_output: default
data_stream: <9>
namespace: default
streams:
- id: "insert a unique identifier here" <10>
data_stream: <9>
dataset: nginx.stubstatus <11>
type: metrics
metricsets: <12>
- stubstatus
hosts:
- 'http://127.0.0.1:80'
period: 10s
server_status_path: /nginx_status
----

<1> For available output settings, refer to <<elastic-agent-output-configuration,Configure outputs for standalone {agents}>>.
<2> For settings specific to the {es} output, refer to <<elasticsearch-output,Configure the {es} output>>.
<3> The URL of the Elasticsearch cluster where output should be sent, including the port number. For example `https://12345ab6789cd12345ab6789cd.us-central1.gcp.cloud.es.io:443`.
<4> For available download settings, refer to <<elastic-agent-standalone-download,Configure download settings for standalone Elastic Agent upgrades>>.
<5> For available monitoring settings, refer to <<elastic-agent-monitoring-configuration,Configure monitoring for standalone {agents}>>.
<6> For available input settings, refer to <<elastic-agent-input-configuration,Configure inputs for standalone {agents}>>.
<7> A user-defined ID to uniquely identify the input stream.
<8> For available input types, refer to <<elastic-agent-inputs-list>>.
<9> Learn about <<data-streams>> for time series data.
<10> Specify a unique ID for each individual input stream. Naming the ID by appending the associated `data_stream` dataset (for example `{user-defined-unique-id}-nginx.stubstatus`) is a recommended practice, but any unique ID will work.
<11> A user-defined dataset. You can specify anything that makes sense to signify the source of the data.
<12> Refer to {integrations-docs}/nginx#metrics-reference[Metrics reference] in the Nginx integration documentation for the type of metrics collected and exported fields.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
These examples show a basic, sample configuration to include in a standalone {agent} `elastic-agent.yml` <<structure-config-file,configuration file>> to gather data from various source types.

* <<config-file-example-apache,Apache HTTP Server>>
* <<config-file-example-apache,Nginx HTTP Server>>

include::config-file-example-apache.asciidoc[leveloffset=+1]
include::config-file-example-nginx.asciidoc[leveloffset=+1]

0 comments on commit 88f6d97

Please sign in to comment.