{"action":"opened","issue":{"url":"https://api.github.com/repos/Yelp/elastalert/issues/1565","repository_url":"https://api.github.com/repos/Yelp/elastalert","labels_url":"https://api.github.com/repos/Yelp/elastalert/issues/1565/labels{/name}","comments_url":"https://api.github.com/repos/Yelp/elastalert/issues/1565/comments","events_url":"https://api.github.com/repos/Yelp/elastalert/issues/1565/events","html_url":"https://github.com/Yelp/elastalert/issues/1565","id":299248574,"number":1565,"title":"Add support for script fields","user":{"login":"ckousik","id":12830755,"avatar_url":"https://avatars2.githubusercontent.com/u/12830755?v=4","gravatar_id":"","url":"https://api.github.com/users/ckousik","html_url":"https://github.com/ckousik","followers_url":"https://api.github.com/users/ckousik/followers","following_url":"https://api.github.com/users/ckousik/following{/other_user}","gists_url":"https://api.github.com/users/ckousik/gists{/gist_id}","starred_url":"https://api.github.com/users/ckousik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckousik/subscriptions","organizations_url":"https://api.github.com/users/ckousik/orgs","repos_url":"https://api.github.com/users/ckousik/repos","events_url":"https://api.github.com/users/ckousik/events{/privacy}","received_events_url":"https://api.github.com/users/ckousik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-22T07:34:52Z","updated_at":"2018-02-22T07:34:52Z","closed_at":null,"author_association":"NONE","body":"I have a use case where I need to aggregate over a script_field:\r\n`\r\n\"script_field\": {\r\n  \"total\": {\r\n        \"lang\": \"expression\",\r\n        \"script\": \"doc[\\\"value1\\\"]+doc[\\\"value2\\\"]\r\n    }\r\n`\r\nI want to trigger an alert if avg of total goes above a certain value using the metric_aggregator. Is there a way to do this with current elastalert features? Adding support for script_fields will surely make use cases like this much easier.\r\n"}}
{"actor":{"display_login":"ckousik"}}