JSON code syntax in visualizations

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
I am using OpenSearch with Wazuh 4.4
Dashboard/visualizations.
Ubuntu server.
Chrome browser.

Describe the issue:
I have created my dashboard in Wazuh with OpenSearch, but I would like to apply formatting to the visualizations. The type of formatting I want to apply includes letter colors, background colors, bolded letters, and others.

Configuration:
Here I show the code that I have been using in the advanced settings of the visualizations for OpenSearch.

This code evaluates whether the ‘rule.description’ field contains the value ‘Windows logon success’. If it does, it will be converted to bold, otherwise it will be left normal, but it is failing.

{
    "style":{
        "fontWeight":{
            "script":{
                "source": "if (doc['rule.description'].value == 'Windows logon success.') { return 'bold' } else { return 'normal' }"
            }
        }
    }       
}

This code is the only one that is working fine, but it’s only changing the result of the ‘rule.description’ field when it is ‘Windows logon success’ to the corresponding values in the IF statement when it is true ‘bold’ and when it is not true, it will be ‘normal’.

{
    "script":{
        "source": "if (doc['rule.description'].value == 'Windows logon success.') { return 'bold' } else { return 'normal' }"
        }
}

Relevant Logs or Screenshots:
For the first case, I am attaching the error.

AFAIK, the script is evaluated on the OpenSearch side and can only manipulate data; it cannot change styling on the frontend of Dashboards unless a formatter exists (coded and compiled into Dashboards) to interpret the modified value on the frontend.