Last active
November 19, 2024 09:26
-
-
Save horacioibrahim/911681feb00ead2dad03b5cd6ccec994 to your computer and use it in GitHub Desktop.
Consulta SQL no ELASTIC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /_sql?format=txt | |
{ | |
"query": """ | |
SELECT payload_parsed.externalId, COUNT(*) as ocurrences FROM "TABLE" // "TABLE*" | |
WHERE payload_parsed.type.keyword = 'MESSAGE_STATUS' | |
AND event_data.source.keyword = 'ZENVIA' | |
AND payload_parsed.channel.keyword = 'email' | |
AND payload_parsed.messageStatus.code.keyword = 'SENT' | |
AND inserted_date >= NOW() - INTERVAL 48 HOUR | |
GROUP BY payload_parsed.externalId HAVING COUNT(*) > 2 | |
""" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment