# Ingesting log .net on Kubernetes

**URL:** <https://community.dynatrace.com/t/ingesting-log-net-on-kubernetes/44432>\
**Category:** Container platforms\
**Tags:** dynatrace-managed, kubernetes, logs\
**Created:** [March 4, 2024, 7:01pm UTC](https://community.dynatrace.com/t/ingesting-log-net-on-kubernetes/44432 "2024-03-04T19:01:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ellery](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Ellery](https://community.dynatrace.com/u/Ellery)\
**Post date:** [March 4, 2024, 7:01pm UTC](https://community.dynatrace.com/t/ingesting-log-net-on-kubernetes/44432/1 "2024-03-04T19:01:23Z")

</div>

Hello,

Hi, my head is splitting trying to set up log ingestion. I’m working on Azure Kubernetes with Dockerized containers. This retrieves a log using log4net, which is created at the path: /app/logs/application.log. The log exists,

```markup
# ls -la /app/logs
total 12
drwxr-xr-x 2 root root 4096 Mar 4 14:43 .
drwxr-xr-x 1 root root 4096 Mar 4 14:43 ..
-rw-r--r-- 1 root root 3204 Mar 4 15:43 application.log

```

this woks ok,

```markup
# tail -f /app/logs/application.log
2024-03-04 14:43:03,232 [11] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=ffa3e2491e89ce51e045d18ded80461b,span_id=843e41f18ab7f063,trace_sampled=true] Application - Main is invoked
2024-03-04 14:43:04,944 [11] ERROR ACHS.FirmaDigital.Api.Program - [!dt trace_id=ffa3e2491e89ce51e045d18ded80461b,span_id=843e41f18ab7f063,trace_sampled=true] [Firmar][Web firmadora] No se encontro la web firmante.
2024-03-04 14:43:05,136 [11] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=ffa3e2491e89ce51e045d18ded80461b,span_id=843e41f18ab7f063,trace_sampled=true] [Firmar][INICIO][17427955-1] Se firmaran 2
2024-03-04 14:43:09,545 [4] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=ffa3e2491e89ce51e045d18ded80461b,span_id=22958368528b0b5c,trace_sampled=true] [Proceso de firma][17427955-1] Tiempo total de ejecución
2024-03-04 14:43:09,650 [4] WARN ACHS.FirmaDigital.Api.Program - [!dt trace_id=ffa3e2491e89ce51e045d18ded80461b,span_id=22958368528b0b5c,trace_sampled=true] [SGP][17427955-1][Info] Se prepara para enviar información a SGP
2024-03-04 14:43:09,732 [4] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=ffa3e2491e89ce51e045d18ded80461b,span_id=22958368528b0b5c,trace_sampled=true] [Firma][17427955-1] Documentos firmados, enviando a digitalización.
2024-03-04 14:43:09,839 [4] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=ffa3e2491e89ce51e045d18ded80461b,span_id=22958368528b0b5c,trace_sampled=true] [Firmar][FIN][17427955-1] Se completo el proceso de firma.
2024-03-04 14:43:09,843 [4] INFO API_FirmaDigital2.Controllers.AdmisionController - [!dt trace_id=ffa3e2491e89ce51e045d18ded80461b,span_id=22958368528b0b5c,trace_sampled=true] [Firmar][FIN][17427955-1]
2024-03-04 15:43:26,582 [29] ERROR ACHS.FirmaDigital.Api.Program - [!dt trace_id=cc674496662e9ddfa3528b34e4f87dd0,span_id=28c6324e98a572f0,trace_sampled=true] [Firmar][Web firmadora] No se encontro la web firmante.
2024-03-04 15:43:26,583 [29] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=cc674496662e9ddfa3528b34e4f87dd0,span_id=28c6324e98a572f0,trace_sampled=true] [Firmar][INICIO][17427955-1] Se firmaran 2
2024-03-04 15:43:26,771 [30] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=cc674496662e9ddfa3528b34e4f87dd0,span_id=b44df715bb86f809,trace_sampled=true] [Proceso de firma][17427955-1] Tiempo total de ejecución
2024-03-04 15:43:26,775 [30] WARN ACHS.FirmaDigital.Api.Program - [!dt trace_id=cc674496662e9ddfa3528b34e4f87dd0,span_id=b44df715bb86f809,trace_sampled=true] [SGP][17427955-1][Info] Se prepara para enviar información a SGP
2024-03-04 15:43:26,776 [30] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=cc674496662e9ddfa3528b34e4f87dd0,span_id=b44df715bb86f809,trace_sampled=true] [Firma][17427955-1] Documentos firmados, enviando a digitalización.
2024-03-04 15:43:26,856 [30] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=cc674496662e9ddfa3528b34e4f87dd0,span_id=b44df715bb86f809,trace_sampled=true] [Firmar][FIN][17427955-1] Se completo el proceso de firma.
2024-03-04 15:43:26,856 [30] INFO API_FirmaDigital2.Controllers.AdmisionController - [!dt trace_id=cc674496662e9ddfa3528b34e4f87dd0,span_id=b44df715bb86f809,trace_sampled=true] [Firmar][FIN][17427955-1]

```

and I’ve set up the rules in Dynatrace."

custom log

 ![Ellery_2-1709578388993.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/e/1e61264d4429d4c8203153794bc874c2cda26e4e.png)

rules ingest

 ![Ellery_3-1709578462865.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/a606467e62ecab1fcb16168a83965040772b388e.png)

So, i have a configurated in a dynatrace but in .json :

**cat /opt/dynatrace/oneagent/agent/conf/securityRulesLoganalytics.json**

```markup
# cat /opt/dynatrace/oneagent/agent/conf/securityRulesLoganalytics.json
{
  "@version": "1.0.0",
  "allowed-log-paths-configuration": [
    {
       "directory-pattern":"/",
       "file-pattern":"*.pem",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"/.ssh/",
       "file-pattern":"*",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"/.*/",
       "file-pattern":"*",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"/",
       "file-pattern":".*",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"^/etc/**/",
       "file-pattern":"*",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"^/boot/**/",
       "file-pattern":"*",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"^/proc/**/",
       "file-pattern":"*",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"^/dev/**/",
       "file-pattern":"*",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"^/bin/**/",
       "file-pattern":"*",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"^/sbin/**/",
       "file-pattern":"*",
       "action":"EXCLUDE"
    },
    {
       "directory-pattern":"^/usr/**/",
       "file-pattern":"*",
       "action":"EXCLUDE"
    },
    {
      "directory-pattern": "/",
      "file-pattern": "*[-.\\_]log[-.\\_]*",
      "action": "INCLUDE"
    },
    {
      "directory-pattern": "/",
      "file-pattern": "*[-.\\_]log",
      "action": "INCLUDE"
    },
    {
      "directory-pattern": "/",
      "file-pattern": "catalina.out*",
      "action": "INCLUDE"
    },
    {
      "directory-pattern": "/log/",
      "file-pattern": "*",
      "action": "INCLUDE"
    },
    {
      "directory-pattern": "/log/*/",
      "file-pattern": "*",
      "action": "INCLUDE"
    },
    {
      "directory-pattern": "/logs/",
      "file-pattern": "*",
      "action": "INCLUDE"
    },
    {
      "directory-pattern": "/logs/*/",
      "file-pattern": "*",
      "action": "INCLUDE"
    },
    {
      "directory-pattern": "^/var/lib/docker/containers/*/",
      "file-pattern": "*.log",
      "action": "INCLUDE"
    },
    {
      "directory-pattern": "^/var/log/**/",
      "file-pattern": "*",
      "action": "INCLUDE"
    }
  ]
}

```

The configuration from the Dynatrace web interface is not reflected and it cannot find custom logs.

 ![Ellery_4-1709578847658.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/c/4c52f448b15819746f341227351d1300c9276097.png)

---

<div class="post-metadata">

**Author:** ![natanael\_mendes](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/natanael_mendes/32/15264_2.png) [@natanael\_mendes](https://community.dynatrace.com/u/natanael_mendes)\
**Post date:** [March 5, 2024, 7:13pm UTC](https://community.dynatrace.com/t/ingesting-log-net-on-kubernetes/44432/2 "2024-03-05T19:13:59Z")

</div>

i think “INICIO” is not on content.

```auto
2024-03-04 14:43:05,136 [11] INFO ACHS.FirmaDigital.Api.Program - [!dt trace_id=ffa3e2491e89ce51e045d18ded80461b,span_id=843e41f18ab7f063,trace_sampled=true] [Firmar][INICIO][17427955-1] Se firmaran 2

```

in this case the content is “Se firmaran 2” inicio is a field on the log. search for “Se firmaran 2” and you gon find this log

---

<div class="post-metadata">

**Author:** ![Ellery](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Ellery](https://community.dynatrace.com/u/Ellery)\
**Post date:** [March 7, 2024, 12:09pm UTC](https://community.dynatrace.com/t/ingesting-log-net-on-kubernetes/44432/3 "2024-03-07T12:09:24Z")

</div>

Don’t work, i make the query,

 ![Ellery_0-1709813259052.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/6/86066f4c942761ed493f1c4be3208bbe95ca4ce1.png)

I thinks that logs dont ingest into dynatrace logs tables, how i can verify thas logs was ingested into dynatrace ?

---

<div class="post-metadata">

**Author:** ![natanael\_mendes](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/natanael_mendes/32/15264_2.png) [@natanael\_mendes](https://community.dynatrace.com/u/natanael_mendes)\
**Post date:** [March 22, 2024, 8:41am UTC](https://community.dynatrace.com/t/ingesting-log-net-on-kubernetes/44432/4 "2024-03-22T08:41:15Z")

</div>

you can filter by the “ingest” field

---

<div class="post-metadata">

**Author:** ![Ellery](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Ellery](https://community.dynatrace.com/u/Ellery)\
**Post date:** [March 26, 2024, 2:38pm UTC](https://community.dynatrace.com/t/ingesting-log-net-on-kubernetes/44432/5 "2024-03-26T14:38:53Z")

</div>

What you means with field “ingest” thats field does’t exist into my query.

---

<div class="post-metadata">

**Author:** ![Suryanto\_1](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Suryanto\_1](https://community.dynatrace.com/u/Suryanto_1)\
**Post date:** [March 27, 2024, 9:41am UTC](https://community.dynatrace.com/t/ingesting-log-net-on-kubernetes/44432/6 "2024-03-27T09:41:31Z")

</div>

Should you be using matchesPhrase instead ?

matchesPhrase(content, “error”)

> **[DQL matcher in logs](https://docs.dynatrace.com/docs/analyze-explore-automate/logs/lma-classic-log-processing/lma-log-processing-matcher)**
>
> Examine specific DQL functions and logical operators for log processing.
