<pattern>: do not include property when value is empty/null
See original GitHub issueSuppose the following pattern:
<pattern>
{
"trace": "%mdc{traceId}"
}
</pattern>
Is there a way to omit the trace
property when there is no such traceId
MDC key?
Something like what #nullNA{...}
does for Access events…
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:10 (2 by maintainers)
Top Results From Across the Web
<pattern>: do not include property when value is empty/null ...
Suppose the following pattern: { "trace": "%mdc{traceId}" } Is there a way to omit the trace property when there is no such traceId...
Read more >c# - What does "is { }" mean? - Stack Overflow
That's just the empty property pattern in C# 8, meaning the value not null . It matches any value type or reference type....
Read more >Matching null values and empty strings in Amazon ...
Null values and empty strings are not interchangeable in pattern matching. An event pattern that matches empty strings doesn't match values of null...
Read more >Understanding non-existent properties and working with nulls
That is, there really is no such thing as a property with a null value; null indicates that the property doesn't exist at...
Read more >Orchestrator Quick Tip: “Null” value conditions
Use the “Matches Pattern” or “Does Not Match pattern” condition and enter the regular expression ^$ which is interpreted as “blank”. thumbnail ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
we would definitely welcome this feature
@wsargent If my understanding is correct, this request is more about excluding a specific field within a pattern based on the the field’s evaluated value, rather than excluding the whole pattern based on a value.
i.e. if the pattern is something like this:
Then only the
trace
field would be omitted if the field value evaluated to null. Thefoo
field would still be included regardless.You could work around this by separating out every possible nullable thing into a different pattern, but that would be cumbersome when working with a large pattern.