目录
输入和输出集成概述
此插件报告 Suricata IDS/IPS 引擎的内部性能计数器,并处理传入数据以适应 Telegraf 的格式。
Telegraf 的 SQL 插件使用简单的表架构和动态列生成将收集的指标发送到 SQL 数据库。当配置为 ClickHouse 时,它会调整 DSN 格式和类型转换设置,以确保无缝数据集成。
集成详情
Suricata
Suricata 插件捕获并报告来自 Suricata IDS/IPS 引擎的内部性能指标,其中包括各种统计信息,例如流量、内存使用情况、正常运行时间以及流和警报的计数器。此插件监听来自 Suricata 的 JSON 格式的日志输出,使其能够解析和格式化数据以与 Telegraf 集成。它作为服务输入插件运行,这意味着它主动等待来自 Suricata 的指标或事件,而不是按预定义的时间间隔收集指标。该插件支持不同指标版本的配置,从而实现增强的灵活性和详细的数据收集。
Clickhouse
Telegraf 的 SQL 插件旨在通过基于传入指标动态创建表和列的方式将指标数据写入 SQL 数据库。当配置为 ClickHouse 时,它使用 clickhouse-go v1.5.4 驱动程序,该驱动程序采用独特的 DSN 格式和一组专门的类型转换规则,以将 Telegraf 的数据类型直接映射到 ClickHouse 的原生类型。这种方法确保了在高吞吐量环境中的最佳存储和检索性能,使其非常适合实时分析和大规模数据仓库。动态模式创建和精确的类型映射实现了详细的时序数据日志记录,这对于监控现代分布式系统至关重要。
配置
Suricata
[[inputs.suricata]]
## Source
## Data sink for Suricata stats log. This is expected to be a filename of a
## unix socket to be created for listening.
# source = "/var/run/suricata-stats.sock"
## Delimiter
## Used for flattening field keys, e.g. subitem "alert" of "detect" becomes
## "detect_alert" when delimiter is "_".
# delimiter = "_"
## Metric version
## Version 1 only collects stats and optionally will look for alerts if
## the configuration setting alerts is set to true.
## Version 2 parses any event type message by default and produced metrics
## under a single metric name using a tag to differentiate between event
## types. The timestamp for the message is applied to the generated metric.
## Additional tags and fields are included as well.
# version = "1"
## Alerts
## In metric version 1, only status is captured by default, alerts must be
## turned on with this configuration option. This option does not apply for
## metric version 2.
# alerts = false
Clickhouse
[[outputs.sql]]
## Database driver
## Valid options include mssql, mysql, pgx, sqlite, snowflake, clickhouse
driver = "clickhouse"
## Data source name
## For ClickHouse, the DSN follows the clickhouse-go v1.5.4 format.
## Example DSN: "tcp://localhost:9000?debug=true"
data_source_name = "tcp://localhost:9000?debug=true"
## Timestamp column name
timestamp_column = "timestamp"
## Table creation template
## Available template variables:
## {TABLE} - table name as a quoted identifier
## {TABLELITERAL} - table name as a quoted string literal
## {COLUMNS} - column definitions (list of quoted identifiers and types)
table_template = "CREATE TABLE {TABLE} ({COLUMNS})"
## Table existence check template
## Available template variables:
## {TABLE} - table name as a quoted identifier
table_exists_template = "SELECT 1 FROM {TABLE} LIMIT 1"
## Initialization SQL (optional)
init_sql = ""
## Maximum amount of time a connection may be idle. "0s" means connections are never closed due to idle time.
connection_max_idle_time = "0s"
## Maximum amount of time a connection may be reused. "0s" means connections are never closed due to age.
connection_max_lifetime = "0s"
## Maximum number of connections in the idle connection pool. 0 means unlimited.
connection_max_idle = 2
## Maximum number of open connections to the database. 0 means unlimited.
connection_max_open = 0
## Metric type to SQL type conversion for ClickHouse.
## The conversion maps Telegraf metric types to ClickHouse native data types.
[outputs.sql.convert]
conversion_style = "literal"
integer = "Int64"
text = "String"
timestamp = "DateTime"
defaultvalue = "String"
unsigned = "UInt64"
bool = "UInt8"
real = "Float64"
输入和输出集成示例
Suricata
-
网络流量分析:利用 Suricata 插件跟踪有关网络入侵尝试和性能的详细指标,从而帮助进行实时威胁检测和响应。通过可视化捕获的警报和流量统计信息,安全团队可以快速查明漏洞并降低风险。
-
性能监控仪表板:使用 Suricata Telegraf 插件指标创建一个仪表板,以监控 IDS/IPS 引擎的健康状况和性能。此用例提供了内存使用情况、捕获的数据包和警报统计信息的概览,使团队能够保持最佳运行状态。
-
自动化安全报告:利用该插件生成关于警报统计信息和流量模式的定期报告,帮助安全分析师识别长期趋势并制定战略防御计划。自动化报告还可以确保持续评估网络的安全性。
-
实时警报处理:将 Suricata 的警报指标集成到更广泛的事件响应自动化框架中。通过整合来自 Suricata 插件的输入,组织可以开发智能触发器,用于警报和自动化响应工作流程,从而提高对潜在威胁的反应时间。
Clickhouse
-
高容量数据的实时分析:使用该插件将来自大规模系统的流式指标馈送到 ClickHouse。此设置支持超快的查询性能和近乎实时的分析,非常适合监控高流量应用程序。
-
时序数据仓库:将该插件与 ClickHouse 集成以创建强大的时序数据仓库。此用例允许组织存储详细的历史指标,并执行复杂的查询以进行趋势分析和容量规划。
-
分布式环境中的可扩展监控:利用该插件在 ClickHouse 中为每种指标类型动态创建表,从而更轻松地管理和查询来自大量分布式系统的数据,而无需事先定义模式。
-
物联网 (IoT) 部署的优化存储:部署该插件以将来自物联网 (IoT) 传感器的数据摄取到 ClickHouse 中。其高效的模式创建和原生类型映射有助于处理海量数据,从而实现实时监控和预测性维护。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。