Skip to content

Truncated slow query logs Neptune

0

Hi,

I want to know how to truncated the info of a slow query log when is export to cloudwatch, because have sensitive data on the query. this is and example.

{
    "requestResponseMetadata": {
        "requestId": "6d6cef28-f855-4d32-9aa3-0353fc94a689",
        "requestType": "websocket",
        "responseStatusCode": 500,
        "exceptionClass": "TimeLimitExceededException"
    },
    "queryStats": {
        "query": "g.withStrategies(new org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy(evaluationTimeout: (int) 100)).V(\"M1\").out(\"MP\").filter(__.and(__.out(\"PC\").has(\"id\",\"P123\"),__.has(\"created_at\",P.gte(new Date(1)).and(P.lt(new Date(2)))),__.has(\"N\",P.within([\"00\"])))).count()",
        "queryFingerprint": "g.withStrategies(org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy.create(new org.apache.commons.configuration.MapConfiguration([(string0):(integer0)]))).V(string1).out(string2).filter(__.and(__.out(string3).has(string4,string5),__.has(string6,P.gte(date0).and(P.lt(date1))),__.has(string7,P.within([string8, string9, string10, string11, string9, string11, string10, string12, string13, string14, string15, string16, string17, string13, string14, string16, string17, string18, string19, string19])))).count()",
        "queryLanguage": "Gremlin"
    },
    "queryTimeStats": {
        "startTimeEpoch": 1724289709234,
        "startTime": "2024-08-22T01:21:49.234Z",
        "overallRunTimeMs": 2703,
        "executionTimeMs": 251
    },
    "statementCounters": {
        "read": 1110
    },
    "transactionCounters": {
        "rolledBack": 1
    },
    "concurrentExecutionStats": {
        "acceptedQueryCountAtStart": 1,
        "runningQueryCountAtStart": 1,
        "acceptedQueryCountAtEnd": 1,
        "runningQueryCountAtEnd": 1
    },
    "queryBatchStats": {
        "queryProcessingBatchSize": 1000,
        "querySerialisationBatchSize": 1000
    }
}

Thank you so much.

asked 2 years ago250 views

1 Answer
1
Accepted Answer

Have you looked at using the native masking features in CloudWatch Logs? https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html

Using a custom data identifier (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL-custom-data-identifiers.html) you can create a regex to mask the portions of the query that you don't want appearing in the logs.

AWS

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Thank you so much, i didn't know about that.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.