Splunk

The splunk integration makes it possible to log all state changes to an external Splunk database using Splunk’s HTTP Event Collector (HEC) feature. You can either use this alone, or with the Home Assistant for Splunk app. Since the HEC feature is new to Splunk, you will need to use at least version 6.3.

Configuration

To use the splunk integration in your installation, add the following to your configuration.yamlconfiguration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] file. 在更改了configuration.yamlconfiguration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] 文件后,重启 Home Assistant 以应用更改。

# Example configuration.yaml entry
splunk:
  token: YOUR_SPLUNK_TOKEN

Configuration Variables

token string Required

The HTTP Event Collector Token already created in your Splunk instance.

host string (Optional, default: localhost)

IP address or host name of your Splunk host, e.g., 192.168.1.10.

port integer (Optional, default: 8088)

Port to use.

ssl boolean (Optional, default: false)

Use HTTPS instead of HTTP to connect.

verify_ssl boolean (Optional, default: true)

Allows you do disable checking of the SSL certificate.

name string (Optional, default: HASS)

This parameter allows you to specify a friendly name to send to Splunk as the host, instead of using the name of the HEC.

filter map (Optional)

Filters for entities to be included/excluded from Splunk. Default is to include all entities. (Configure Filter)

include_domains list (Optional)

Domains to be included.

include_entity_globs list (Optional)

Include all entities matching a listed pattern (e.g., sensor.weather_*).

include_entities list (Optional)

Entities to be included.

exclude_domains list (Optional)

Domains to be excluded.

exclude_entity_globs list (Optional)

Exclude all entities matching a listed pattern (e.g., sensor.weather_*).

exclude_entities list (Optional)

Entities to be excluded.

Configure filter

By default, no entity will be excluded. To limit which entities are being exposed to Splunk, you can use the filter parameter.

# Example filter to include specified domains and exclude specified entities
splunk:
  token: YOUR_SPLUNK_TOKEN
  filter:
    include_domains:
      - alarm_control_panel
      - light
    include_entity_globs:
      - binary_sensor.*_occupancy
    exclude_entities:
      - light.kitchen_light

Filters are applied as follows:

  1. 不使用过滤器
    • 包含所有实体
  2. 仅包含
    • 实体列表中的实体包含:include
    • 否则,实体匹配域包含:include
    • 否则,实体匹配通配符包含:include
    • 否则:排除
  3. 仅排除
    • 实体列表中的实体排除:exclude
    • 否则,实体匹配域排除:exclude
    • 否则,实体匹配通配符排除:exclude
    • 否则:包含
  4. 域和/或通配符包含(还可能有排除)
    • 实体列表中的实体包含:include
    • 否则,实体列表中的排除:exclude
    • 否则,实体匹配通配符包含:include
    • 否则,实体匹配通配符排除:exclude
    • 否则,实体匹配域包含:include
    • 否则:排除
  5. 域和/或通配符排除(没有域和/或通配符包含)
    • 实体列表中的实体包含:include
    • 否则,实体列表中的排除:exclude
    • 否则,实体匹配通配符排除:exclude
    • 否则,实体匹配域排除:exclude
    • 否则:包含
  6. 没有域和/或通配符的包含或排除
    • 实体列表中的实体包含:include
    • 否则:排除

以下字符可用于实体通配符:

* - 星号表示零个、一个或多个字符
? - 问号表示零个或一个字符