# LogStash Configurations for Log4Net, Log4J etc

**URL:** <https://discuss.elastic.co/t/logstash-configurations-for-log4net-log4j-etc/336258>\
**Category:** Logstash\
**Created:** [June 16, 2023, 7:41pm UTC](https://discuss.elastic.co/t/logstash-configurations-for-log4net-log4j-etc/336258 "2023-06-16T19:41:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomahawk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomahawk/32/122258_2.png) [@Tomahawk](https://discuss.elastic.co/u/Tomahawk)\
**Post date:** [June 16, 2023, 7:41pm UTC](https://discuss.elastic.co/t/logstash-configurations-for-log4net-log4j-etc/336258/1 "2023-06-16T19:41:03Z")

</div>

Bit of a left field question…..

In a highly regulated space and restricted industry, log files coming from multiple apps (100-200) with Log4Net and Log4J, Python Native logging libraries. No real customisation done by the devs.

In the absence (it’ll just never happen for these in env they’re in) of being able to get them to adopt an ECS library or FileBeat (they just pushed out to a streaming service for us to sub and process)…..

Is there a standard set of LogStash configuration pipelines for popular logging libraries like Log4Net, Log4J, Python native logging libraries. Allowing us to just push with the same ECS schema we have for the less regulated apps to Elasticsearch.

In this situation what would you suggest…

---

<div class="post-metadata">

**Author:** ![Tomahawk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomahawk/32/122258_2.png) [@Tomahawk](https://discuss.elastic.co/u/Tomahawk)\
**Post date:** [June 19, 2023, 10:35am UTC](https://discuss.elastic.co/t/logstash-configurations-for-log4net-log4j-etc/336258/2 "2023-06-19T10:35:03Z")

</div>

No bueno? 🙂

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 19, 2023, 11:55am UTC](https://discuss.elastic.co/t/logstash-configurations-for-log4net-log4j-etc/336258/3 "2023-06-19T11:55:34Z")

</div>

> [@Tomahawk](#):
>
> Is there a standard set of LogStash configuration pipelines for popular logging libraries like Log4Net, Log4J, Python native logging libraries.

I don't think such thing exists, the definition of what will be logged using any of those libraries is done by the users according to its uses cases, so a pipeline would depends on the fields of each log.

If you can't change the format of the logs on the source, you will need to create a pipeline for each use case to transform the fields in ecs fields.

For example, one log may use `srcip`, other may use `source_ip` and others may use `SourceIp`, you would need to have a transformation for each one of those fields.

Something like this:

```auto
mutate {
    rename => {
        "srcip" => "[source][ip]"
        "source_ip" => "[source][ip]"
        "SourceIp" => "[source][ip]"
    }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 17, 2023, 11:56am UTC](https://discuss.elastic.co/t/logstash-configurations-for-log4net-log4j-etc/336258/4 "2023-07-17T11:56:23Z")

</div>

Closed on July 17, 2023, 11:56am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
