-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support fields with spaces in the name #99
Comments
wfchandler
pushed a commit
to wfchandler/angle-grinder
that referenced
this issue
Jul 23, 2021
Related to rcoh#99 Currently field names containing a space or period, e.g. `date received` or `grpc.method`, cannot be parsed. This could be worked around using `jq` or similar tools to rewrite the field name, but that's a pain. This commit adds an escaped field name syntax of `["<FIELD>"]` which is based on the Object Identifier-Index syntax[0] used by `jq`, so it should be somewhat familiar to many people who parse JSON on the command line. The more obvious option of delimiting with just quotes, e.g. "date received", creates an ambiguity between string literals and escaped field names. For example, does `where foo == "date received"` mean field `foo` matches field `date received`, or field `foo` matches the string "date received"? Example query: ``` * | json | where ["grpc.method"] == "Foo" | count by ["date received"] ``` [0] https://stedolan.github.io/jq/manual/#ObjectIdentifier-Index:.foo,.foo.bar
wfchandler
pushed a commit
to wfchandler/angle-grinder
that referenced
this issue
Jul 23, 2021
Related to rcoh#99 Currently field names containing a space or period, e.g. `date received` or `grpc.method`, cannot be parsed. This could be worked around using `jq` or similar tools to rewrite the field name, but that's a pain. This commit adds an escaped field name syntax of `["<FIELD>"]` which is based on the Object Identifier-Index syntax[0] used by `jq`, so it should be somewhat familiar to many people who parse JSON on the command line. The more obvious option of delimiting with just quotes, e.g. "date received", creates an ambiguity between string literals and escaped field names. For example, does `where foo == "date received"` mean field `foo` matches field `date received`, or field `foo` matches the string "date received"? Example query: ``` * | json | where ["grpc.method"] == "Foo" | count by ["date received"] ``` [0] https://stedolan.github.io/jq/manual/#ObjectIdentifier-Index:.foo,.foo.bar
wfchandler
pushed a commit
to wfchandler/angle-grinder
that referenced
this issue
Jul 23, 2021
Related to rcoh#99 Currently field names containing a space or period, e.g. `date received` or `grpc.method`, cannot be parsed. This could be worked around using `jq` or similar tools to rewrite the field name, but that's a pain. This commit adds an escaped field name syntax of `["<FIELD>"]`. This is based on the Object Identifier-Index syntax[0] used by `jq`, so it should be somewhat familiar to many people who parse JSON on the command line. The more obvious option of delimiting with just quotes, e.g. "date received", creates an ambiguity between string literals and escaped field names. For example, does `where foo == "date received"` mean field `foo` matches field `date received`, or field `foo` matches the string "date received"? Example query: ``` * | json | where ["grpc.method"] == "Foo" | count by ["date received"] ``` [0] https://stedolan.github.io/jq/manual/#ObjectIdentifier-Index:.foo,.foo.bar
wfchandler
pushed a commit
to wfchandler/angle-grinder
that referenced
this issue
Jul 23, 2021
Related to rcoh#99 Currently field names containing a space or period, e.g. `date received` or `grpc.method`, cannot be parsed. This could be worked around using `jq` or similar tools to rewrite the field name, but that's a pain. This commit adds an escaped field name syntax of `["<FIELD>"]`. This is based on the Object Identifier-Index syntax[0] used by `jq`, so it should be somewhat familiar to many people who parse JSON on the command line. The more obvious option of delimiting with just quotes, e.g. "date received", creates an ambiguity between string literals and escaped field names. For example, does `where foo == "date received"` mean field `foo` matches field `date received`, or field `foo` matches the string "date received"? Example query: ``` * | json | where ["grpc.method"] == "Foo" | count by ["date received"] ``` [0] https://stedolan.github.io/jq/manual/#ObjectIdentifier-Index:.foo,.foo.bar
wfchandler
pushed a commit
to wfchandler/angle-grinder
that referenced
this issue
Jul 23, 2021
Related to rcoh#99 Currently field names containing a space, period, or escaped quote, e.g. `date received` or `grpc.method`, cannot be parsed. This could be worked around using `jq` or similar tools to rewrite the field name, but that's a pain. This commit adds an escaped field name syntax of `["<FIELD>"]`. This is based on the Object Identifier-Index syntax[0] used by `jq`, so it should be somewhat familiar to many people who parse JSON on the command line. The more obvious option of delimiting with just quotes, e.g. "date received", creates an ambiguity between string literals and escaped field names. For example, does `where foo == "date received"` mean field `foo` matches field `date received`, or field `foo` matches the string "date received"? Example query: ``` * | json | where ["grpc.method"] == "Foo" | count by ["date received"] ``` [0] https://stedolan.github.io/jq/manual/#ObjectIdentifier-Index:.foo,.foo.bar
rcoh
pushed a commit
that referenced
this issue
Jul 23, 2021
Related to #99 Currently field names containing a space, period, or escaped quote, e.g. `date received` or `grpc.method`, cannot be parsed. This could be worked around using `jq` or similar tools to rewrite the field name, but that's a pain. This commit adds an escaped field name syntax of `["<FIELD>"]`. This is based on the Object Identifier-Index syntax[0] used by `jq`, so it should be somewhat familiar to many people who parse JSON on the command line. The more obvious option of delimiting with just quotes, e.g. "date received", creates an ambiguity between string literals and escaped field names. For example, does `where foo == "date received"` mean field `foo` matches field `date received`, or field `foo` matches the string "date received"? Example query: ``` * | json | where ["grpc.method"] == "Foo" | count by ["date received"] ``` [0] https://stedolan.github.io/jq/manual/#ObjectIdentifier-Index:.foo,.foo.bar Co-authored-by: Will Chandler <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
eg.
Date Received
The text was updated successfully, but these errors were encountered: