Skip to content

Commit

Permalink
Merge pull request #520 from dynatrace-oss/NOISSUE-fix-cloud_sql-region
Browse files Browse the repository at this point in the history
NOISSUE-fix-cloud_sql-region
  • Loading branch information
joaquinfilipic-dynatrace authored May 31, 2024
2 parents ae043ff + 47ffba0 commit f44dcf6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/config_logs/google-sql/cloud_sql.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"key": "gcp.instance.id",
"pattern": "resource.labels.database_id"
},
{
"key": "cloud.region",
"pattern": "resource.labels.region | lower_region(@)"
},
{
"key": "gcp.region",
"pattern": "resource.labels.region | lower_region(@)"
},
{
"key": "content",
"pattern": "@"
Expand Down
6 changes: 5 additions & 1 deletion src/lib/logs/jmespath.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ def _func_status_from_proto_code(self, proto_code):
@functions.signature({'types': ['string']}, {'types': ['string']})
def _func_split(self, sep, string):
return string.split(sep)


@functions.signature({'types': ['string']})
def _func_lower_region(self, string):
return string.lower().replace('_','-')

@functions.signature({'types': ['string']},
{'types': ['string']},
{'types': ['string']})
Expand Down

0 comments on commit f44dcf6

Please sign in to comment.