Created
January 7, 2020 00:03
-
-
Save anelson-vidscale/5406d0b15b15adb3df47be9d180cbf51 to your computer and use it in GitHub Desktop.
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
Elasticsearch query | |
"aggs": { | |
"by_site": { | |
"terms": { | |
"field": "site", | |
"size": 500 | |
}, | |
"aggs": { | |
"by_top_hits" : { | |
"top_hits": { | |
"size": 1, | |
"_source": ["site_type"], | |
"sort": [ { "@timestamp": { "order": "desc" } } ] | |
} | |
} | |
} | |
} | |
-------------------------------------------------------------------------------------- | |
Vega | |
{ | |
"name": "joined", | |
"source": "alerts", | |
"transform": [ { "type": "lookup", "from": "site_to_sitetype", "key": "site", "values": ["site_type"], "fields": ["site"], "as": ["site_typer"], "default" : "no-site-type" } ] | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment