1 Pluspunkt 0 Minuspunkte

Wie kann ich diesen Query so umschreiben das er alle Einträge findet wo das Wort "NTLM" nicht vorkommt?

GET /wazuh-alerts-4.x-2025.02.28/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "data.win.eventdata.authenticationPackageName": "NTLM"
          }
        },
        {
          "match": {
            "data.win.eventdata.logonType": "NTLM"
          }
        }
      ],
      "minimum_should_match": 1
    }
  }
}

von  

1 Antwort

0 Pluspunkte 0 Minuspunkte

Statt "shoud" verwende "must_not".

GET /wazuh-alerts-4.x-2025.02.28/_search
{
  "query": {
    "bool": {
      "must_not": [
        {
          "match": {
            "data.win.eventdata.authenticationPackageName": "NTLM"
          }
        },
        {
          "match": {
            "data.win.eventdata.logonType": "NTLM"
          }
        }
      ]
    }
  }
}
von (778 Punkte)