How to extract value from LogstashMarker to use in conversionRule? (logstash-logback-encoder 7.3) #1112
Unanswered
neverovskii
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I have a specific need to include value from
LogstashMarker(in this caseObjectAppendingMarker) that was previously saved with log to JSON output defined via pattern:For that need I've defined custom Conversion Rule as follows:
<conversionRule conversionWord="msg_detailed" converterClass="foo.bar.MessageDetailedMarkerConverter"/>But I've encountered the problem that
.getFieldValue()is protected forObjectAppendingMarkerandSingleFieldAppendingMarker.I've decided not to use
LogstashMarkersJsonProviderto write that into JSON output because:message_detailedis written strictly aftermessagefield, without messing with JsonGenerator logic;Is there any other type of Marker I can use to easily receive it's value, or any other way to achieve the exact result? From looking at what library provides my guess is that the best course of action is to extend
ObjectAppendingMarker/SingleFieldAppendingMarkerand open the access tofieldValueand write that object as log marker.Beta Was this translation helpful? Give feedback.
All reactions