elasticsearch,Security,elasticsearch" /> elasticsearch,Security,elasticsearch" />

Security 使用弹性搜索识别失败的登录

Security 使用弹性搜索识别失败的登录,security,elasticsearch,Security,elasticsearch,我有一个我正在研究的特定用例,它涉及创建一个查询,每当从一台机器上的两个独立帐户登录失败时,该查询将返回事件 我已经创建了以下查询,但是每当我尝试运行它时都会收到错误 { "query": { "filtered": { "query": { "match_all": {} }, "filter" : { "term": { "EventID": "4625"

我有一个我正在研究的特定用例,它涉及创建一个查询,每当从一台机器上的两个独立帐户登录失败时,该查询将返回事件

我已经创建了以下查询,但是每当我尝试运行它时都会收到错误

{
"query": {
    "filtered": {
       "query": {
            "match_all": {}
       },
       "filter" : {
           "term": {
              "EventID": "4625"
           }
       },
       "filter" : {
            "range" : { 
                "_timestamp" : { 
                    "gt": "now-15m"
                }
            }
        }
    }
},
aggs: {
    group_by_host: {
        terms: {
            field: 'hostname'
        },
        aggs: {
            group_by_user: {
                terms: {
                    field: 'username'
                }
            }
        }
    }
}  

任何

您都需要将过滤器包装在
bool
中。有关更多信息,请参阅

试试这个

{
  "query": {
    "filtered": {
      "query": {
        "match_all": {}
      },
      "filter": {
        "bool": {
          "must": [
            {
              "term": {
                "EventID": "4625"
              }
            },
            {
              "range": {
                "_timestamp": {
                  "gt": "now-15m"
                }
              }
            }
          ]
        }
      }
    }
  },
  "aggs": {
    "group_by_host": {
      "terms": {
        "field": "hostname"
      },
      "aggs": {
        "group_by_user": {
          "terms": {
            "field": "username"
          }
        }
      }
    }
  }
}

我尝试了那个查询,但我得到了回报:take:244103超时:False _碎片:@{total=199;successful=199;failed=0}命中率:@{total=0;max_score=;hits=System.Object[]}聚合:@{groupu by_host=}这意味着查询不匹配任何文档,因此结果为零