Event Bridge Rules to Filter Null fields

0

I am trying to filter payloads when a specific field is null (not empty string). I could not find any reference for the support of NOT condition in eb rules - with which I can write a condition e.g., [not {"fieldName": null}]

Would really appreciate if someone could help.

Anirban
질문됨 한 달 전163회 조회
2개 답변
0

If you want events that the field is null, you should use "fieldName": [null].

If you want events that the field is not null, you should use "fieldName": [ { "anything-but": null } ].

profile pictureAWS
전문가
Uri
답변함 한 달 전
  • Hi Uri, I am getting following error while trying this solution.

    Event pattern is not valid. Reason: Value of anything-but must be an array or single string/number value.

  • My bad, sorry. It seems there is no way of doing that. If the field has a known list of values, just include them in the filter.

0

Hello.

There is no "Not" filter, so why not try using "anything-but" instead?
I thought that by using "anything-but", it would be possible to express that "fieldName" is other than Null.
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns-content-based-filtering.html#eb-filtering-anything-but

{"fieldName": [{"anything-but": null}]}
profile picture
전문가
답변함 한 달 전
  • Hi Riku, thanks for adding. I do not thik anything-but supports null

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠