Back to Geneos FAQ

Internal documentation only

This page has been marked as draft.

Commands - Arguments different output to Geneos

CAUSE Copied

Geneos processes custom command inputs in a way that may automatically escape special characters within a data block. This behaviour is intentional and designed to prevent parsing errors or injection-related issues in other contexts.

However, in scenarios where you are sending structured payloads (such as JSON in a curl request), this escaping can modify the original data before it reaches the endpoint.

What Happens Copied

Even if your curl command successfully reaches the target endpoint, the payload may contain additional escape characters inserted by Geneos.

For example, consider the following command configured directly in Geneos:

curl -X POST https://api.example.com/endpoint \
  -H "Content-Type: application/json" \
  -d '{"message":"Test message","status":"OK"}'

Geneos may transform the payload internally into something similar to:

{\"message\":\"Test message\",\"status\":\"OK\"}

As a result:

This behavior is by design and cannot be disabled within standard custom command configuration.

SOLUTION Copied

Use an External Script Copied

The best practice is to move complex commands (especially those containing structured data or special characters) into an external script and invoke that script from Geneos.

This avoids inline parsing and escaping issues, because Geneos only executes the script rather than interpreting the payload content.

Example 1: Shell Script (Linux) Copied

Create a script file, e.g., post_payload.sh:

#!/bin/bash

API_URL="https://api.example.com/endpoint"
MESSAGE="Test message"
STATUS="OK"

curl -X POST "$API_URL" \
  -H "Content-Type: application/json" \
  -d "{\"message\":\"$MESSAGE\",\"status\":\"$STATUS\"}"

Make it executable:

chmod +x post_payload.sh

Then configure the Geneos custom command to call:

/path/to/post_payload.sh
["Geneos"] ["Geneos > Gateway"] ["FAQ"]

Was this topic helpful?