Отсутствует значение при использовании команды оповещения в elastalert - PullRequest
0 голосов
/ 03 октября 2019

Я пытаюсь использовать приведенный ниже файл правил с предупреждением о слабом состоянии. Мне удалось получить предупреждение с правильными значениями при изменении предупреждения с слабого на командное предупреждение, которое я получаю для аргументов, передаваемых в сценарии оболочки.

Rulefile

######################################################################
#  Alert if service team has not run the tool in the last 24 hours   #
######################################################################
# (Required)
# Rule name, must be unique
name: last-execution-check
# (Required)
# Type of alert
type: flatline
# (Required)
# Index to search, wildcard supported
index: query-tracking-*
# All documents must have a timestamp field.
# ElastAlert will try to use @timestamp by default, but this can be changed with the timestamp_field option
timestamp_field: "End Time"
# The minimum number of events for an alert not to be triggered
threshold: 1
# The time period that must contain less than threshold events
#timeframe:
#  hours: 24
timeframe:
  minutes: 2
# With flatline rule, query_key means that an alert will be triggered if any value of query_key has been seen at least once and then falls below the threshold.
query_key: "Service.keyword"
# The _type of document to search for (see the value of the "_type" field within Kibana)
doc_type: "_doc"
# ElastAlert will make an aggregation query against Elasticsearch to get counts of documents matching each unique value of query_key
use_terms_query: true
# (Required)
# A list of Elasticsearch filters used for find events
# These filters are joined with AND and nested in a filtered query
# For more info: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html
filter:
  - query_string:
      query: "*"
realert:
  minutes: 5
# The alert is use when a match is found
alert:
  - command
command: ["scripts/post_new_relic.sh", "--event_type=last_execution_check", "--key_value_list=service:%(Service)s,environment:%(Environment)s,last_run:%(Start Time)s"]

Здесь я хочу передать значения для Service, Environment и Start Time. но я получаю в журналах.

Нажмите здесь, чтобы проверить журналы

Я сделал поиск в Google и обнаружил, сохраняя use_terms_query как ложное или удалив его, может помочьв получении ценностей. Я пробовал то же самое, но у меня не работает.

У кого-нибудь есть идеи, что с этим не так?

...