Insert custom key-value pair into cmdb_key_value inside pattern
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 07:54 AM - edited 04-03-2024 08:07 AM
I am trying to insert custom (static) key-value pair into the cmdb_key_value table using pattern. I have a working script which does insert key-value pairs into the cmdb_key_value table for specific CI type and I am trying to use this script inside a pattern. I looked EVAL to kick-off the script without any luck (I am not sure if eval is designed to do this type of action). I have also looked some of the patterns (kubernetes/virtual machines) key-value pairs discovery and the creation of the relationship. For some reason I couldn't get it to work (I can share the steps if needed).
I am also looking pattern pre-postscript which could be viable solution here, but I am reaching out to see if this can be done inside a pattern.
Here is what i tried:
1. set keyValue Example: "app, microsoft,computerName"
2. parse key value: KeyValueTable [key,app,configuration_item]
3. add label to CMDB_KEY_VALUE TABLE: Union Tables (first table KeyValueTable, second table cmdb_key_value, third table cmdb_key_value
4. create reference between key-value and host:
parent table cmdb_key_value,
child table cmdb_ci_win_server,
results cmdb_ci_win_server,
direction parent to child,
column name "configuration_item
criteria "Field Matching"
parent table field configuration_item
child table filed name