It looks like you're running into a Lua script error in the Fluent Bit configuration related to masking personal identifiable information in your Dapr setup on AKS. The specific error message indicates that the variable input is not defined, which is causing the Lua function to fail.
Here’s a breakdown of the problem and some potential steps you can take:
Problem Overview - The error message you're seeing:
error code 2: /fluent-bit/etc/filters.lua:33: bad argument #1 to 'gsub' (string expected, got nil) - suggests that when your function MaskPersonalIdentifiableInformation tries to call string.gsub on input, it's receiving nil instead of a string, leading to the crash.
Steps to Resolve - Define 'input': Ensure that input is properly defined and initialized before it's used in the function. In your case, it appears there should be a variable that holds the raw log data (possibly the same as 'value' from the record). You might want to change value to input in the line:
value = string.gsub(input, &((***Redacted***by***CredScan***))", "REDACTED")
If input refers to a different source, make sure it’s initialized or defined properly.
Check Record Fields: Ensure all fields you intend to process exist in your log record. If a log entry happens to miss either the Message or DaprRawLog fields, this could lead to nil values being passed to gsub.
Add logging inside the Lua function to track which values are being processed, especially before the gsub call. This can help identify which log entries are causing the issue.
Reporting the Issue - Since this seems to be an issue with the Dapr setup rather than directly related to Azure support, it would be appropriate to report this in the Dapr GitHub repository.
please make sure to provide a clear description of the issue, including your environment details (AKS version, Dapr version, and any relevant configurations).
Here are some links to relevant documentation for further insights into troubleshooting and configuring Dapr in Azure AKS: