Converting a JSON object to JSON string by using the Stringify JSON field rule
In IBM® Cloud Logs, you can use the Stringify JSON field rule to reduce the amount of indexed fields stored for search.
Using this rule, you can change an array or an object from JSON format to text to reduce the number of fields. However, this still keeps the data in IBM® Cloud Logs to be searchable by using free text search.
Before you begin
Parsing rules are organized inside Rule Groups. Each group has a name and a set of rules with a logical relationship between them. Logs are processed according to the order of rule group (from the beginning to the end). They are then
processed by the order of rules within the rule group and according to the logical operators between them (AND/OR
). Rules help you to process, parse, and restructure log data to prepare for monitoring and analysis. For more information,
see Working with rule groups.
Configuring a Stringify JSON field rule
Complete the following steps:
-
Click the Data pipeline icon > Parsing rules and click New Rule Group.
-
In the Details section, enter the Rule Group Name and the Rule Group Description.
-
In the Rule Matcher section, configure the applications, subsystems, and severities that define the logs on which to apply the rules that are included in the rules group.
-
In the Rules section, select Stringify JSON field .
Enter a name.
Optionally, enter a description.
For Source Field, enter the field you want to convert to text.
Configure if you want to keep or delete the source field.
-
Select Keep if you want to keep the original field with its content.
-
Select Delete if you want to delete the original field and its content.
For Destination Field, enter the field where you want the content of the source to be saved.
Toggle the status to ACTIVE if you want the rule to be enabled.
-
-
Add additional rule groups by clicking Add Rule and selecting the desired rule type. Toggle AND/OR to select how you would like the additional rules processed.
-
Click Create Rule Group.
Configuring a Stringify JSON field rule using the API
Complete the following steps:
Sample
In the following example, the sessionIssuer
field, which is an object, is changed to text and given the name application
.