{subject: payload.headers[?name=='Subject'].value, labelIds:map(&(!contains(['UNREAD', 'CATEGORY_PERSONAL', 'INBOX'], @) && [@]) || [] ,labelIds)[]}
OR {subject: payload.headers[?name=='Subject'].value, labelIds:labelIds[*][(!contains(['UNREAD', 'CATEGORY_PERSONAL', 'INBOX'], @) && @) ||[]][]}
Hi everyone, I have a question. Is it possible to use the result of a query to search again? For example, say we have the slightly modified example from jmespath.org
{
"locations": [
{"name": "Seattle", "state": "WA"},
{"name": "New York", "state": "NY"},
{"name": "Bellevue", "state": "WA"},
{"Seattle": "Olympia", "state": "WA"}
]
}
could this query
{value: @, key: keys(@)[?ends_with(@, 'Seattle')]} | @.value.[@.key]
return "Olympia"??
locations[?ends_with(state, 'A')].name
v1
&& involvedObject.kind == Service
&& involvedObject.name==my-name
].{ firstTimestamp: firstTimestamp, lastTimestamp: lastTimestamp, count: count, reason: reason, message: message }
search([-x:], [0, 1, 2, 3]) -> [2, 3]
where x is a number - the last x entries
for the last 5 you'd do something like
resources[?involvedObject.apiVersion == v1 && involvedObject.kind == Service && involvedObject.name==my-name].{ firstTimestamp: firstTimestamp, lastTimestamp: lastTimestamp, count: count, reason: reason, message: message }[-5:]
...at least that's what I think you'd have to do
{
"tags": {
"private_password_reset": {
"tag_name": "PasswordResetSettings"
},
"users": {
"tag_name": "users"
}
}
}
result should be: PasswordResetSettings, users
join(', ', tags.*.tag_name)
^[8-9]\d{7}$
[89]\d{7}
[89]\\d{7}