# Log metric extraction not working

**URL:** <https://community.dynatrace.com/t/log-metric-extraction-not-working/48263>\
**Category:** Dynatrace Managed\
**Tags:** dynatrace-managed, log-monitoring-class\
**Created:** [October 10, 2024, 5:08pm UTC](https://community.dynatrace.com/t/log-metric-extraction-not-working/48263 "2024-10-10T17:08:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DamianG](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/damiang/32/15906_2.png) [@DamianG](https://community.dynatrace.com/u/DamianG)\
**Post date:** [October 10, 2024, 5:08pm UTC](https://community.dynatrace.com/t/log-metric-extraction-not-working/48263/1 "2024-10-10T17:08:52Z")

</div>

Hi all,

I have the SQL Extension running on my environment, adding logs automatically. I would like to extract a value from the logs using log metrics, but it is not working.

- Sample logs:

 ![DamianG_0-1728579647374.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/7cf5f5d41a8bd346e9cc9dcd84ca61900ca79bc7.png)

- Log details: some entries contains details of the SQL “largest\_files”, as attributes (such as file\_name, file\_size):

 ![DamianG_2-1728579753974.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/3b0744e2200506a36ad5c3a43432650e061f56e0.png)

I created a processing rule but it is not working:

 ![DamianG_3-1728579819704.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/37d7248142d3b69ef95a0e116f6017d2bcd52af9.png)

where I used \<\<content=“\\MSSQL\\DATA\\”\>\> as filter for the log entries.&nbsp;I’m using the attributes included in each log entry, but metric extraction rule is not working:

 ![DamianG_4-1728579884452.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/7/d7fa6f8c236d2d2d0a28afa522d360bc7fea3988.png)

What I’m doing wrong?

Thank you.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [October 11, 2024, 3:00pm UTC](https://community.dynatrace.com/t/log-metric-extraction-not-working/48263/2 "2024-10-11T15:00:29Z")

</div>

Hi,

Which value do you want to extract?

I would create processing rule from log viewer:

 ![AntonPineiro_0-1728658633116.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/8/18f42f9acdb840131accd7263655824e4e8eb8d8.png)

Because it would add log content in rule for testing:

 ![AntonPineiro_1-1728658652489.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/d/2defaceace6aa12d1f07fe8b5b050fb26c82fe4a.png)

And you can create processor definition and test rule, as preview. And you can save it when you see it is working as expected.

Best regards

---

<div class="post-metadata">

**Author:** ![DamianG](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/damiang/32/15906_2.png) [@DamianG](https://community.dynatrace.com/u/DamianG)\
**Post date:** [October 14, 2024, 6:43am UTC](https://community.dynatrace.com/t/log-metric-extraction-not-working/48263/3 "2024-10-14T06:43:18Z")

</div>

Hi,

I’ve created the processing rule using log viewer as you said. In addition, I’ve created a processor definition, based in the automatic log content in rule for testing:

 ![DamianG_2-1728887910423.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/3/a3f1bbc05b0b88306eb3ecb2fb261e5aa47c4b0b.png)

 ![DamianG_0-1728887493310.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/5db3df2b93f6031e79db0ab1e8f492f3c78f5d6b.png)

I think this step should not be needed, as the log content is based in **attributes** added automatically by the log monitoring:

 ![DamianG_1-1728887843896.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/3/b3e8ec9e1699f854958315a858d1c4a8e1708e58.png)

Anyway, the processing rule is created and, after that, the “Metrics extraction” rule as follows:

 ![DamianG_3-1728887968239.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/b/2bee565830d88ea3394a5cc01a17fb30fb8fea21.png)

 ![DamianG_4-1728888016999.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/b/8b945c0f56bc4882d14f8c3f305bd8df4ac6ec57.png)

Attribute “file\_name”, “database”, “file\_size” and “server” are already visible automatically in the Log Viewer, as mentioned before, and also included in the log processing rule.&nbsp; But the metric is not available yet.

Thank you.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [October 14, 2024, 8:55am UTC](https://community.dynatrace.com/t/log-metric-extraction-not-working/48263/4 "2024-10-14T08:55:57Z")

</div>

Hi,

As it is a metric, can you try to add file\_size as attribute? It means, file\_size as attribute, and file\_name as dimension.

Just to try as file\_size is INT value, maybe does not like to add STRING as metric.

Best regards

---

<div class="post-metadata">

**Author:** ![DamianG](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/damiang/32/15906_2.png) [@DamianG](https://community.dynatrace.com/u/DamianG)\
**Post date:** [October 14, 2024, 12:23pm UTC](https://community.dynatrace.com/t/log-metric-extraction-not-working/48263/5 "2024-10-14T12:23:57Z")

</div>

Hi,

Good point! I’ve changed as suggested ( **file\_size** as attribute) and now it is working:

 ![DamianG_0-1728908544926.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/1/51720cb7f1c842ce7495f26312fc4c6c8cbae79b.png)

Thank you so much for your help!

Regards

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [October 14, 2024, 5:17pm UTC](https://community.dynatrace.com/t/log-metric-extraction-not-working/48263/6 "2024-10-14T17:17:45Z")

</div>

Hi,

I was not sure 100% but and I will remember it for sure!&nbsp;😉

Best regards
