edit-icon download-icon

JSON type

Last Updated: Apr 19, 2018

JSON contains multiple data types, including text, boolean, value, array, and map.

Instructions

Text type

For JSON fields, fields of text type and boolean type are automatically recognized.

For example, the following jsonkey can be queried by using the conditions such as jsonkey.key1:"text_value" and jsonkey.key2:true.

  1. jsonkey: {
  2. key1:text_value,
  3. key2:true,
  4. key3:3.14
  5. }

Value type

You can query the double or long type data that is not in the JSON array by setting the type and specifying the path.

For example, the type of the jsonkey.key3 field is double. Then, the query statement is as follows:

  1. jsonkey.key3 > 3

JSON field including invalid content

Log Service attempts to parse the valid contents until the invalid content appears.

Example:

  1. "json_string":
  2. {
  3. "key_1" : "value_1",
  4. "key_map" :
  5. {
  6. "key_2" : "value_2",
  7. "key_3" : "valu

Data after key_3 is truncated and lost. The field json_string.key_map.key_2 and contents before this field are successfully parsed.

Instructions

  • JSON object type and JSON array type are not supported.
  • The field cannot be in a JSON array.
  • Boolean fields can be converted to the text type.

Query syntax

To query a specific key, you must add the parent path prefix of JSON in the query statement. The text type and value type of JSON have the same query syntax as those of non-JSON. For more information, see Query syntax.

Thank you! We've received your feedback.