Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 853 Bytes

elasticsearchQueryRule.md

File metadata and controls

28 lines (22 loc) · 853 Bytes

Query Rule

rule {
    //...
    params = [
            "index": "logstash-*",
            "query": [query: [
                                        bool: [
                                            must: [
                                                    ["range": ["@timestamp": ["gt": lastSeenTimestamp]]],
                                                    ["match": [ "message": "error" ]]
                                                ]
                                            ]
                                         ]
                                    ]
    ]

    reaction { messages -> // All messages that match the query
            // Your logic here
    }

}
  • As a query you can use all power of the search API