Skip to content

Custom actions

Custom actions turn values from a log or span into clickable jumps to Coralogix screens, internal tools, dashboards, or third-party services. Define a URL template once with placeholders that pull fields from the selected log or span, then trigger the action from any matching record to open the destination with the right context already filled in. No more manual copy-paste between tools.

What you need

To create actions, you need permission to manage actions in your Coralogix account and a dataset that contains the fields you plan to inject into URLs. To trigger an action, the destination must accept browser navigation. Most in-product routes and third-party web apps qualify.

Open the Actions panel

  1. Go to Explore, then select Logs or Spans.
  2. Select the more actions menu, then select Manage actions.

    Explore more actions menu with Manage actions highlighted at the bottom

The Actions panel opens on the right with two sections:

  • Private: actions only you can see and use.
  • Shared: actions created by you or others that are visible to the team.

Create an action

  1. From the Actions panel, select Add new action.
  2. Fill in the form:
    • Name: the label shown in the action menu and catalog.
    • URL template: the destination URL with {{...}} placeholders that pull fields from the selected log or span. URLs must start with http:// or https://.
    • Description: a short note explaining when to use the action.
    • Filters: narrow when the action appears by application, subsystem, or other attributes. Toggle Exact match to require an exact value match on every filter.
    • Access: Private keeps the action to your account, and Shared makes it visible to teammates under the Shared section of the catalog.
  3. Select Save.

    New action form with the URL template, data type, advanced options, and save controls

The action appears in the catalog and is immediately available wherever its filters and data type apply.

URL template variables

Use double curly braces ({{ }}) anywhere in the URL template. Three variable namespaces are available:
VariableWhat it resolves toExample
$dFields from the selected log or span, including nested paths.{{$d.trace_id}}, {{$d.log_str.span_id}}
$mCoralogix metadata fields attached to the log or span.{{$m.applicationName}}, {{$m.subsystemName}}, {{$m.severity}}, {{$m.timestamp}}
$lSpan fields, available only when the active dataset is spans.{{$l.span_id}}, {{$l.trace_id}}, {{$l.service.name}}
$pPage and query context. Values from the current Explore session and the value the user selected.{{$p.start_date}}, {{$p.end_date}}, {{$p.selected_value}}

Use $p.selected_value when the action should pass the specific value the user selects. Actions that include $p.selected_value only appear in the value menu, not in the row-level menu.

Selected values are URL-encoded (encodeURIComponent) before substitution, so values that contain spaces, slashes, or other reserved characters reach the destination intact. Resolved URLs open in a new browser tab with noopener and noreferrer set on the link.

JavaScript expressions

Anything inside {{ }} is evaluated as a JavaScript expression. You can branch on field values, build composite strings, or call standard JavaScript functions:

https://example.com/?env={{ $m.subsystemName === "frontend" ? "Front" : "Back" }}

Bracket notation for special characters

For field names that contain hyphens, spaces, or that start with a digit, use bracket notation instead of dot notation:

https://example.com/?id={{$d["order-id"]}}&user={{$d["123_user"]}}

Trigger an action

After saving, an action becomes available wherever its Data type and Filters match the current log or span.

  1. Run a query in Explore so the grid contains the log or span you want to act on.
  2. Open the action menu in one of two ways:
    • From a row: open the more actions menu next to the row. Only actions that do not use {{$p.selected_value}} appear here.
    • From an attribute value: select the value of any field in the log or span. The cell menu shows Custom Actions with a submenu of every matching action. {{$p.selected_value}} resolves to the selected value.
  3. In the Custom Actions submenu:
    • Use the search box to find an action by name.
    • Switch between the All, Private, and Shared tabs to filter by access scope.
    • Select Manage actions at the bottom to open the Actions panel and create or edit actions.
  4. Select the action. The destination URL opens in a new browser tab with all placeholders replaced.

Custom actions in Spans tab

An action is only listed when every placeholder in its URL template resolves from the current row data. Actions with unresolved placeholders are hidden from the submenu — there is no greyed-out state. If you expect an action to appear and it doesn't, check that the row contains all the fields the URL template references.

Example URL templates

Authoring an action follows the same shape every time. Take the destination URL, replace each dynamic value with {{$d.field}}, {{$m.field}}, or {{$p.selected_value}}, paste the result into URL template, give the action a name, and save. The same recipe handles a Coralogix screen, a Grafana board, and a Jira ticket. Only the destination URL changes.

The recipes below cover the most common workflows. Replace the angle-bracketed placeholders (<team>, <your-domain>, and so on) with values from your account, and adjust the field names to match your log shape.

Open the related trace. Jump from a log to its trace, with the time window centered on the log's timestamp. Best when the log carries a trace_id.

https://<team>.coralogix.com/#/tracing/{{$d.trace_id}}?start={{$m.timestamp*1000 - 3000000000}}&end={{$m.timestamp*1000 + 3000000000}}

Pivot to a filtered logs query. Open Explore filtered to logs that share a key with the current log, over the same time range.

https://<team>.coralogix.com/#/explore/logs?queryType=lucene&query=<key>:"{{$d.<key>}}"&from={{$p.start_date}}&to={{$p.end_date}}

Pivot from a log to its spans. Open the Spans dataset filtered to the same trace_id as the current log.

https://<team>.coralogix.com/#/explore/spans?queryType=lucene&query=trace_id:"{{$d.trace_id}}"&from={{$p.start_date}}&to={{$p.end_date}}

Open a RUM session. Move from a log carrying session_id to all events in that user's session.

https://<team>.coralogix.com/#/explore/logs?queryType=lucene&query=cx_rum.session_context.session_id:"{{$d.session_id}}"

Open a Grafana dashboard for the service. Land on a Grafana board pre-filtered to the service that emitted the log.

https://grafana.<your-domain>.com/d/<dashboard-id>/<dashboard-name>?var-service={{$m.subsystemName}}

Create a Jira ticket pre-filled from the log. Open the Jira issue-creation form with the summary and description populated from log fields.

https://<your-atlassian-domain>.atlassian.net/secure/CreateIssueDetails!init.jspa?pid=<jira_pid>&issuetype=<jira_issue_type>&summary={{$d.msg}}&description={{$d.logRecord.body}}

Search the web for the clicked value. Look up an error string, identifier, or message from the log. Use $p.selected_value so the action only appears in the value menu and passes the exact clicked value.

https://www.google.com/search?q={{$p.selected_value}}

Branch the destination by environment. Use a JavaScript ternary to send production logs to one URL and others to a different one.

https://<team>.example.com/{{ $m.subsystemName === "prod" ? "prod-tools" : "staging-tools" }}/incident?id={{$d.incident_id}}

Limitations

AreaLimit
URL schemeMust start with http:// or https://. Other schemes (mailto:, slack:, custom protocols) are not supported.
Triggering surfaceActions trigger from individual log rows or attribute values. They are not available from chart visualizations, aggregations, or grouped views.
Value-aware actionsActions that include {{$p.selected_value}} appear only in the attribute-value menu, not on the row-level menu.
VariablesOnly the $d, $m, and $p namespaces are supported. References to other namespaces are passed through literally and produce broken URLs.
AuthenticationThe destination opens in a new browser tab. The user must already be signed in to that destination. Actions cannot pass credentials.

Troubleshoot

ProblemCauseResolution
The action does not appear on a logThe action's filters or data type exclude the current log.Open the action and remove or adjust the filters. Confirm the log is from the right data type.
The action only shows in the value menu, not the row menuThe URL template includes {{$p.selected_value}}.Trigger the action by clicking an attribute value, or remove $p.selected_value from the template if you want a row-level action.
The opened URL has empty placeholdersThe selected log does not contain the referenced field.Add a filter to the action so it only appears on logs that include the field, or rewrite the template with a fallback expression.
The action will not saveThe URL does not start with http:// or https://.Prefix the URL with the correct scheme.
A field with a hyphen renders as a JavaScript errorDot notation cannot reference fields with hyphens, spaces, or leading digits.Use bracket notation: {{$d["my-field"]}}.
Teammates cannot see an actionThe action's Access is set to Private.Edit the action and switch Access to Shared.

Support

Reach the Coralogix customer success team 24/7 via in-app chat or by email at [email protected].