I have an issue with LLD version 6.
I have a template am building
I have a key
SSH directory content
vfs.dir.get[/etc/ssh,^ssh.*,^ssh_config,file,,0,,,,,]
returns json
[{"basename":"sshd_config","pathname":"/etc/ssh/sshd_config","dirname":"/etc/ssh","type":"file","user":"root","group":"root","p ermissions":"0600","uid":0,"gid":0,"size":4269,"ti me":{"access":"2022-02-08T11:31:16+0000","modify":"2021-05-27T16:54:22+0100","change":"2022-02-02T12:13:30+0000"},"timestamp":{"access":164431987 6,"modify":1622130862,"change":1643804010}},{"base name":"ssh_host_ed25519_key","pathname":"/etc/ssh/ssh_host_ed25519_key","dirname":"/etc/ssh","type":"file","user":"root","group":"985","pe rmissions":"0600","uid":0,"gid":985,"size":387,"ti me":{"access":"2022-02-15T12:24:11+0000","modify":"2020-08-03T09:51:15+0100","change":"2022-02-02T12:32:09+0000"},"timestamp":{"access":164492785 1,"modify":1596444675,"change":1643805129}}]
I have a discovery key with the following LLD macro
$..basename
I have an item prototype
key : ssh.owner.[{#BASENAME}]
preprocessing
json path $[?(@.basename == "{#BASENAME}")].uid
replace [
replace ]
issue is the keys are getting created like
ssh.owner.["["sshd_config"]"]
instead of like
ssh.owner.["sshd_config"]
which then cause my preprocessing to fail.
how can I go about fixing the discovery rule to correctly name the keys ?
I have a template am building
I have a key
SSH directory content
vfs.dir.get[/etc/ssh,^ssh.*,^ssh_config,file,,0,,,,,]
returns json
[{"basename":"sshd_config","pathname":"/etc/ssh/sshd_config","dirname":"/etc/ssh","type":"file","user":"root","group":"root","p ermissions":"0600","uid":0,"gid":0,"size":4269,"ti me":{"access":"2022-02-08T11:31:16+0000","modify":"2021-05-27T16:54:22+0100","change":"2022-02-02T12:13:30+0000"},"timestamp":{"access":164431987 6,"modify":1622130862,"change":1643804010}},{"base name":"ssh_host_ed25519_key","pathname":"/etc/ssh/ssh_host_ed25519_key","dirname":"/etc/ssh","type":"file","user":"root","group":"985","pe rmissions":"0600","uid":0,"gid":985,"size":387,"ti me":{"access":"2022-02-15T12:24:11+0000","modify":"2020-08-03T09:51:15+0100","change":"2022-02-02T12:32:09+0000"},"timestamp":{"access":164492785 1,"modify":1596444675,"change":1643805129}}]
I have a discovery key with the following LLD macro
$..basename
I have an item prototype
key : ssh.owner.[{#BASENAME}]
preprocessing
json path $[?(@.basename == "{#BASENAME}")].uid
replace [
replace ]
issue is the keys are getting created like
ssh.owner.["["sshd_config"]"]
instead of like
ssh.owner.["sshd_config"]
which then cause my preprocessing to fail.
how can I go about fixing the discovery rule to correctly name the keys ?
Comment