# Elasalert2のエラーに関して

**URL:** https://discuss.elastic.co/t/elasalert2/329262
**Category:** 日本語による質問・議論はこちら
**Created:** [April 4, 2023, 1:07am UTC](https://discuss.elastic.co/t/elasalert2/329262 "2023-04-04T01:07:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![YUUTA.INOUE-JPN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuuta.inoue-jpn/32/117963_2.png) [@YUUTA.INOUE-JPN](https://discuss.elastic.co/u/YUUTA.INOUE-JPN)
#### Post date: [April 4, 2023, 1:07am UTC](https://discuss.elastic.co/t/elasalert2/329262/1 "2023-04-04T01:07:28Z")

</div>

お世話になります  
elasrticsearch と kibana を使用して、異常なイベントについて管理者にメールを送信できるようにしたいと考えています。  
この目的で elastalert2 を使用していますが、フィルターがエラーになっています。  
この問題に多くの時間を費やしましたが、解決できませんでした。  
どうか思い当たる事や解決法に関するノウハウがございましたらご教示いただけますと幸いです  
よろしくお願いいたします

私のelastalertコマンドと結果は次のとおりです。

elastalert-test-rule --config elastalert2/config.yaml examples/rules/example\_frequency.yaml --alert

##########################

##########################  
Error running your filter:  
TypeError("Elasticsearch.search() got multiple values for argument 'body'")

1 rules loaded  
INFO:apscheduler.scheduler:Adding job tentatively -- it will be properly scheduled when the scheduler starts  
INFO:elastalert:Queried rule Example frequency rule from 2023-03-29 23:21 UTC to 2023-03-29 23:36UTC: 0 / 0 hits  
INFO:elastalert:Queried rule Example frequency rule from 2023-03-29 23:36 UTC to 2023-03-29 23:51UTC: 0 / 0 hits  
INFO:elastalert:Queried rule Example frequency rule from 2023-03-29 23:51 UTC to 2023-03-30 00:06UTC: 0 / 0 hits  
INFO:elastalert:Queried rule Example frequency rule from 2023-03-30 00:06 UTC to 2023-03-30 00:21UTC: 0 / 0 hits  
INFO:elastalert:Queried rule Example frequency rule from 2023-03-30 00:21 UTC to 2023-03-30 00:22UTC: 0 / 0 hits

Would have written the following documents to writeback index (default is elastalert\_status):

elastalert\_status - {'rule\_name': 'Example frequency rule', 'endtime': datetime.datetime(2023, 3,30, 0, 22, 6, 480746, tzinfo=tzutc()), 'starttime': datetime.datetime(2023, 3, 29, 23, 21, 30, 480746,  
tzinfo=tzutc()), 'matches': 0, 'hits': 0, '@timestamp': datetime.datetime(2023, 3, 30, 0,22, 6, 548239, tzinfo=tzutc()), 'time\_taken': 0.03283810615539551}

##########################

私の elastalert ルール ファイルは次のとおりです。

name: Example frequency rule  
type: frequency  
index: winlogbeat-7.6.2-\*  
num\_events: 1  
timeframe:  
hours: 1  
filter:

term:  
hostname: ".xxx.xxx.co.jp"  
alert:  
"email"  
email:  
"xxx.xxx@xxxxxxxxxx.co.jp"  
smtp\_host: "xxxxxxmail.jp"  
smtp\_port: 25  
smtp\_ssl: false  
from\_addr: "xxxxxxxxx@xxxx.xxxxx.co.jp"  
alert\_text\_type: alert\_text\_only

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 2, 2023, 1:08am UTC](https://discuss.elastic.co/t/elasalert2/329262/2 "2023-05-02T01:08:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
