Hello,
I try to print browser use agent values from aggregated bucket:
"ctx.payload.aggregations.ua_buckets.buckets": [
{ "doc_count": 11,
"key": "Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.0;+Trident/4.0;+Acoo+Browser;+GTB5;+Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1)+;+InfoPath.1;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30618)"
},
{
"doc_count": 11,
"key": "Mozilla/5.0+(compatible;+MSIE+8.0;+Windows+NT+6.0;+Trident/4.0;+Acoo+Browser+1.98.744;+.NET+CLR+3.5.30729)"
},
with the following script:
{
"script": "return [ myhost: ctx.payload.aggregations.ua_buckets.buckets.collect { [ myua:it.key, mycount:it.doc_count ] } ]"
}
I also tried myua:it.key_as_string
However, values are nulls:
"actions": [
{
"id": "notify_log",
"type": "logging",
"status": "success",
"transform": {
"type": "script",
"status": "success",
"payload": {
"myhost": [
{
"myua": null,
"mycount": 11
},
{
"myua": null,
"mycount": 11
},
"logging": {
"logged_text": "User Agent - # of attempts
- 11
- 11
- 11
- 10
- 10
- 10
- 8
- 7
- 7
- 7
"
Please advise