Comments (6)
- Regarding renaming
source_host
tohost
,exception.exception_class
toexception.class
, andthread_name
tothread
, I intentionally picked those field names to be aligned with the official logstash/log4j-jsonevent-layout project. (Am I missing something here?) In case of a particular need, you can provide your own JSON template. - Providing an interface for variable substitution makes totally sense. I will check how can I do that.
- Extending MDC and NDC maps can be a little bit challenging given the lack of a proper JSON schema processor solution. What do you think of adding two new properties:
mdc_extension
andndc_extension
? I can merge these withmdc
andndc
maps respectively prior to logging. - About filtering MDC and NDC maps, would a simple
mdcKeyPattern
andndcKeyPattern
having a regex statement address your case? As you can imagine, these will definitely add quite some regex processing overhead to the logging too.
from log4j2-logstash-layout.
Thanks Volkan,
- Extending context: what about an "LDC" map (logger DC) at the Logger level, and copy it in a separate JSON field instead of merging maps? Another idea: be able to add custom fields in particular type/tags fields in order to be able to process logs differently on Logstash depending on matching appender (at the moment having a different layout for each appender is painful).
- Filtering MDC/NDC: a list of authorized fields is enough for my usecase. This means iterating over this list and fetch values from the map instead of iterating over the map entries. Another idea: make filtering plugable (a predicate over map entries).
from log4j2-logstash-layout.
- Extending context: From your description I understood that you just want to have a custom map similar to MDC/NDC. Right? If so, why not creating a map entry (i.e.
"ldc": {"foo": "bar", "baz": "moo"}
) in a custom JSON template? Am I misinterpreting your explanation? - Filtering MDC/NDC: Do you want to filter on keys, values, or both?
from log4j2-logstash-layout.
Just pushed v0.4 to Maven Central. Added mdcKeyPattern
and ndcPattern
configuration parameters. Further, Log4j 2.x Lookup support is integrated.
from log4j2-logstash-layout.
Thanks. I'll reopen a new issue to be able to get environnement vars/system properties in template.
from log4j2-logstash-layout.
@gquintana, I've already released that feature. Let me know if it doesn't work for you.
from log4j2-logstash-layout.
Related Issues (20)
- BufferOverflowException get thrown for messages of a larger size HOT 7
- LogstashLayout with log4j2-elasticsearch appender HOT 1
- Introduce properties to globally set LogstashLayout.Builder defaults
- Nullpointer exceptions at LogstashLayoutSerializationContexts$StringTruncatingGeneratorDelegate HOT 1
- Any template ready for GCP? HOT 9
- Message lost if exceeding maxStringLength and emptyPropertyExclusionEnabled is true HOT 4
- Use ByteArrayOutputStream instead of ByteBufferOutputStream to avoid message loss HOT 8
- Stacktraces larger than maxStringLength are not truncated HOT 7
- Failed serializing JSON: BufferOverflowException HOT 10
- How to output ThreadContext (ex -MDC fields) HOT 1
- Review request for Log4j JsonTemplateLayout HOT 7
- How exactly is MapMessage supposed to be handled? HOT 7
- Multiple template variables in single property lead to an exception HOT 2
- Fallback for json:map: fields for libraries HOT 1
- NoClassDefFoundError: logstash.layout.resolver.TemplateResolvers (initialization failure) HOT 1
- Remove max byte count cap? HOT 1
- Reference whole MapMessage - and not just keys HOT 13
- Compiling with JDK 8 results in java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer; HOT 4
- Marker lookup subsitutes literal string when marker not available HOT 1
- BufferOverflowException occurs intermittently when sending data via socket appender HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log4j2-logstash-layout.