# Ingest MSSQL logs to Dynatrace and create a problem when condition matches

**URL:** <https://community.dynatrace.com/t/ingest-mssql-logs-to-dynatrace-and-create-a-problem-when-condition-matches/46871>\
**Category:** Logs\
**Tags:** mssql, data-ingest, logs\
**Created:** [July 29, 2024, 3:03pm UTC](https://community.dynatrace.com/t/ingest-mssql-logs-to-dynatrace-and-create-a-problem-when-condition-matches/46871 "2024-07-29T15:03:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![binodkumarroy](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@binodkumarroy](https://community.dynatrace.com/u/binodkumarroy)\
**Post date:** [July 29, 2024, 3:03pm UTC](https://community.dynatrace.com/t/ingest-mssql-logs-to-dynatrace-and-create-a-problem-when-condition-matches/46871/1 "2024-07-29T15:03:33Z")

</div>

Hi Team,

I am trying to ingest MSSQL Logs to Dynatrace and create the Problem when condition matches.

Logs contain 2 lines which is related to same Error, I would like to put the condition in Dynatrace if it contains **severity :20** then create a problem and append complete second line in the problem:

**2024-07-06 23:23:17.60** spid265 Error: 18056, Severity: 20, State: 23.  
**2024-07-06 23:23:17.60** spid265 The client was unable to reuse a session with SPID 25, which had been reset for connection pooling. The failure ID is 23. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.

Regards,

Binod

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [July 30, 2024, 9:15am UTC](https://community.dynatrace.com/t/ingest-mssql-logs-to-dynatrace-and-create-a-problem-when-condition-matches/46871/2 "2024-07-30T09:15:29Z")

</div>

Hi Binod,

I think you can get this creating a [processing rule](https://docs.dynatrace.com/docs/shortlink/log-monitoring-log-processing) and a [log event](https://docs.dynatrace.com/docs/observe-and-explore/log-monitoring/analyze-log-data/log-events#createlogevent)&nbsp;.

The processing rule to doing something like [this](https://docs.dynatrace.com/docs/shortlink/log-monitoring-log-processing-examples#lpexample2) to capture the second line to use the content capture in a custom attribute that you will use in the log event.

The log event to capture “severity:20” content for event type “Error”.

 ![erh_inetum_0-1722330423314.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/04879502c0e847231a7e07ed841dbc615e3df5af.png)

And finally, adding the custom attribute you define in the processing rule like:

 ![erh_inetum_2-1722330734624.png](https://global.discourse-cdn.com/dynatrace/original/2X/1/1a2b78a85da88578e1e05ecd16215947f63c86c8.png)

Hope it helps.

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![binodkumarroy](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@binodkumarroy](https://community.dynatrace.com/u/binodkumarroy)\
**Post date:** [July 30, 2024, 10:03am UTC](https://community.dynatrace.com/t/ingest-mssql-logs-to-dynatrace-and-create-a-problem-when-condition-matches/46871/3 "2024-07-30T10:03:05Z")

</div>

Thanks Elena. Let me try this and update if it works.
