The JSON property injector process allows the creation of new key/value pairs in the output JSON record. You can inject one or more key/value pairs using this process as described here.
If this process is deployed then all JSON key names will be sorted into strict ascending Unicode character order. In general, this means numbers sort lowest followed by upper case letters which sort before lower case letters. New JSON key/value pairs are inserted into the re-ordered list of key/value pairs in the appropriate place.
When the ProcessType is set to JsonPropertyInjector, a parent field named JsonPropertyInjectorConfiguration must be populated with one or more pairs of Name and Value fields as shown below. You may have any number of Name and Value pairs as you wish.
If you enter items that are not correctly paired, the process will be invalid and the pipeline will not start.
|
{
"Name": "Injector1",
"Id": "b3f6eeae-5f9b-44a8-aacd-efe7dbc57f38",
"JsonPropertyInjectorConfiguration":
{ "InjectedProperties": [
{ "Name":"status", "Value":"critical" } ,
{ "Name":"primary_property", "Value":"host" },
{ "Name":"secondary_property", "Value":"JobNameJobId" },
{ "Name":"host", "AnnotationName":"HostName" }
]
},
"ProcessType": "JsonPropertyInjector"
}
Here we are injecting four new key/value pairs, three are fixed text and the fourth is dynamically replaced by the host name of the source system at the time the pipeline is started.
{"queryfield1":"success", "FIELD2":"shortsearch"}
{"FIELD2":"shortsearch", "host":"prodserver7.bigcorp.com",
"primary_property":"host", "queryfield1":"success",
secondary_property":"JobNameJobId" }