目录
输入和输出集成概述
Syslog 插件允许使用标准网络协议从各种来源收集系统日志消息。此功能对于需要有效监控和记录系统的环境至关重要。
Sumo Logic 插件旨在促进将指标从 Telegraf 发送到 Sumo Logic 的 HTTP 源。通过使用此插件,用户可以在 Sumo Logic 平台中分析其指标数据,从而利用各种输出数据格式。
集成详情
Syslog
Telegraf 的 Syslog 插件捕获通过各种协议(如 TCP、UDP 和 TLS)传输的系统日志消息。它支持 RFC 5424(较新的系统日志协议)和较旧的 RFC 3164(BSD 系统日志协议)。此插件作为服务输入运行,有效地启动一个服务来监听传入的系统日志消息。与传统插件不同,服务输入可能无法与标准间隔设置或 CLI 选项(如 --once
)一起使用。它包括用于设置网络配置、套接字权限、消息处理和连接处理的选项。此外,与 Rsyslog 的集成允许转发日志消息,使其成为实时收集和中继系统日志的强大工具,从而无缝集成到监控和日志系统中。
Sumo Logic
此插件有助于将指标传输到 Sumo Logic 的 HTTP 源,并采用指定的数据格式用于 HTTP 消息。Telegraf 必须是 1.16.0 或更高版本,可以发送以多种格式编码的指标,包括 graphite
、carbon2
和 prometheus
。这些格式对应于 Sumo Logic 识别的不同内容类型,确保指标得到正确解释以进行分析。与 Sumo Logic 集成后,用户可以利用全面的分析平台,从而从其指标数据中获得丰富的可视化效果和见解。该插件提供了配置选项,例如设置 HTTP 指标源的 URL、选择数据格式以及指定其他参数(如超时和请求大小),从而增强了数据监控工作流程的灵活性和控制力。
配置
Syslog
[[inputs.syslog]]
## Protocol, address and port to host the syslog receiver.
## If no host is specified, then localhost is used.
## If no port is specified, 6514 is used (RFC5425#section-4.1).
## ex: server = "tcp://localhost:6514"
## server = "udp://:6514"
## server = "unix:///var/run/telegraf-syslog.sock"
## When using tcp, consider using 'tcp4' or 'tcp6' to force the usage of IPv4
## or IPV6 respectively. There are cases, where when not specified, a system
## may force an IPv4 mapped IPv6 address.
server = "tcp://127.0.0.1:6514"
## Permission for unix sockets (only available on unix sockets)
## This setting may not be respected by some platforms. To safely restrict
## permissions it is recommended to place the socket into a previously
## created directory with the desired permissions.
## ex: socket_mode = "777"
# socket_mode = ""
## Maximum number of concurrent connections (only available on stream sockets like TCP)
## Zero means unlimited.
# max_connections = 0
## Read timeout (only available on stream sockets like TCP)
## Zero means unlimited.
# read_timeout = "0s"
## Optional TLS configuration (only available on stream sockets like TCP)
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Enables client authentication if set.
# tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]
## Maximum socket buffer size (in bytes when no unit specified)
## For stream sockets, once the buffer fills up, the sender will start
## backing up. For datagram sockets, once the buffer fills up, metrics will
## start dropping. Defaults to the OS default.
# read_buffer_size = "64KiB"
## Period between keep alive probes (only applies to TCP sockets)
## Zero disables keep alive probes. Defaults to the OS configuration.
# keep_alive_period = "5m"
## Content encoding for message payloads
## Can be set to "gzip" for compressed payloads or "identity" for no encoding.
# content_encoding = "identity"
## Maximum size of decoded packet (in bytes when no unit specified)
# max_decompression_size = "500MB"
## Framing technique used for messages transport
## Available settings are:
## octet-counting -- see RFC5425#section-4.3.1 and RFC6587#section-3.4.1
## non-transparent -- see RFC6587#section-3.4.2
# framing = "octet-counting"
## The trailer to be expected in case of non-transparent framing (default = "LF").
## Must be one of "LF", or "NUL".
# trailer = "LF"
## Whether to parse in best effort mode or not (default = false).
## By default best effort parsing is off.
# best_effort = false
## The RFC standard to use for message parsing
## By default RFC5424 is used. RFC3164 only supports UDP transport (no streaming support)
## Must be one of "RFC5424", or "RFC3164".
# syslog_standard = "RFC5424"
## Character to prepend to SD-PARAMs (default = "_").
## A syslog message can contain multiple parameters and multiple identifiers within structured data section.
## Eg., [id1 name1="val1" name2="val2"][id2 name1="val1" nameA="valA"]
## For each combination a field is created.
## Its name is created concatenating identifier, sdparam_separator, and parameter name.
# sdparam_separator = "_"
Sumo Logic
[[outputs.sumologic]]
## Unique URL generated for your HTTP Metrics Source.
## This is the address to send metrics to.
# url = "https://events.sumologic.net/receiver/v1/http/"
## Data format to be used for sending metrics.
## This will set the "Content-Type" header accordingly.
## Currently supported formats:
## * graphite - for Content-Type of application/vnd.sumologic.graphite
## * carbon2 - for Content-Type of application/vnd.sumologic.carbon2
## * prometheus - for Content-Type of application/vnd.sumologic.prometheus
##
## More information can be found at:
## https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Upload-Metrics-to-an-HTTP-Source#content-type-headers-for-metrics
##
## NOTE:
## When unset, telegraf will by default use the influx serializer which is currently unsupported
## in HTTP Source.
data_format = "carbon2"
## Timeout used for HTTP request
# timeout = "5s"
## Max HTTP request body size in bytes before compression (if applied).
## By default 1MB is recommended.
## NOTE:
## Bear in mind that in some serializer a metric even though serialized to multiple
## lines cannot be split any further so setting this very low might not work
## as expected.
# max_request_body_size = 1000000
## Additional, Sumo specific options.
## Full list can be found here:
## https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Upload-Metrics-to-an-HTTP-Source#supported-http-headers
## Desired source name.
## Useful if you want to override the source name configured for the source.
# source_name = ""
## Desired host name.
## Useful if you want to override the source host configured for the source.
# source_host = ""
## Desired source category.
## Useful if you want to override the source category configured for the source.
# source_category = ""
## Comma-separated key=value list of dimensions to apply to every metric.
## Custom dimensions will allow you to query your metrics at a more granular level.
# dimensions = ""
</code></pre>
输入和输出集成示例
Syslog
-
集中式日志管理:使用 Syslog 插件将来自多台服务器的日志消息聚合到中央日志记录系统中。此设置可以通过收集来自不同来源的系统日志数据,帮助监控整体系统健康状况、有效排除问题并维护审计跟踪。
-
实时警报:将 Syslog 插件与警报工具集成,以在检测到特定日志模式或错误时触发实时通知。例如,如果日志中出现关键系统错误,则可以向运维团队发送警报,从而最大限度地减少停机时间并执行主动维护。
-
安全监控:通过捕获来自防火墙、入侵检测系统和其他安全设备的日志,利用 Syslog 插件进行安全监控。此日志记录功能增强了安全可见性,并通过分析捕获的系统日志数据来帮助调查潜在的恶意活动。
-
应用程序性能跟踪:通过收集来自各种应用程序的日志,利用 Syslog 插件来监控应用程序性能。这种集成有助于分析应用程序的行为和性能趋势,从而帮助优化应用程序流程并确保更顺畅的运行。
Sumo Logic
-
实时系统监控仪表板:使用 Sumo Logic 插件将服务器的性能指标持续馈送到 Sumo Logic 仪表板中。此设置允许技术团队实时可视化系统健康状况和负载,从而通过详细的图表和指标更快地识别任何性能瓶颈或系统故障。
-
自动化警报系统:配置插件以发送在 Sumo Logic 中触发警报的指标,用于特定阈值,例如 CPU 使用率或内存消耗。通过设置自动化警报,团队可以在问题升级为严重故障之前主动解决问题,从而显着提高响应时间和整体系统可靠性。
-
跨系统指标聚合:跨不同环境(开发、测试、生产)集成多个 Telegraf 实例,并使用此插件将所有指标汇集到中央 Sumo Logic 实例。这种聚合实现了跨环境的全面分析,从而促进了更好的监控和整个软件开发生命周期的知情决策。
-
具有维度跟踪的自定义指标:使用 Sumo Logic 插件发送自定义指标,其中包括标识基础设施各个方面的维度(例如,环境、服务类型)。这种精细的跟踪允许进行更有针对性的分析,使您的团队能够剖析跨不同应用程序层或业务功能的性能。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提供意见。请在 InfluxDB 社区 Slack 中提交您的反馈。