Take input from elk index and need to send notification over email against invalid inputs

This looks exactly the same as Send a notification mail for invalid inputs made to the index (filebeat)?