Muokkaa

Jaa


bag_keys()

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

Enumerates all the root keys in a dynamic property bag object.

Syntax

bag_keys(object)

Learn more about syntax conventions.

Parameters

Name Type Required Description
object dynamic ✔️ The property bag object for which to enumerate keys.

Returns

An array of keys, order is undetermined.

Example

datatable(index:long, d:dynamic) [
    1, dynamic({'a':'b', 'c':123}), 
    2, dynamic({'a':'b', 'c':{'d':123}}),
    3, dynamic({'a':'b', 'c':[{'d':123}]}),
    4, dynamic(null),
    5, dynamic({}),
    6, dynamic('a'),
    7, dynamic([])
]
| extend keys = bag_keys(d)

Output

index d keys
1 {
"a": "b",
"c": 123
}
[
"a",
"c"
]
2 {
"a": "b",
"c": {
"d": 123
}
}
[
"a",
"c"
]
3 {
"a": "b",
"c": [
{
"d": 123
}
]
}
[
"a",
"c"
]
4
5 {} []
6 a
7 []