Datadog URLs to ChaosSearch

The URL text for a context link can be a basic link to a specific ChaosSearch page, or it can also pass in variables to include some information taken from the dashboard widget to input some information to ChaosSearch.

The Context Link URL field displays a variety of variables when you click in the field to specify URL information. These variables include:

  • {{timestamp_start}}
  • {{timestamp_end}}
  • {{timestamp_widget_start}}
  • {{timestamp_widget_end}}
  • {{tags}} (these are Query Variables)

The Datadog online help for context links offers more information about the variables and their effect. For example, you can create template variables on the dashboard.

Specifying Time Ranges for ChaosSearch

When you use the timestamp variables, you must pass the desired time in a format that Search Analytics can interpret. Create the time values by starting with epoch time 0 (1970-01-01T00:00:00.000Z) and adding the epoch time in seconds (||+{epoch}ms). You can use the Datadog timestamp variables like {{timestamp_widget_start}} and {{timestamp_widget_end}} to pass in the epoch milliseconds value that you want to add to the epoch time 0, for example:

time:(from:'1970-01-01T00:00:00.000Z||+{{timestamp_widget_start}}ms',mode:absolute,
to:'1970-01-01T00:00:00.000Z||+{{timestamp_widget_end}}ms'))

A sample URL follows:

https://mycompany.chaossearch.io/#/analytics?pathname=%252Fkibana%252Fapp%252Fdiscover&kibana=
%2523%252F%253F_g%253D(filters%253A!()%252CrefreshInterval%253A(pause%253A!t%252Cvalue%253A0)%252C
time%253A(from%253A'1970-01-01T00%253A00%253A00.000Z%25257C%25257C%25252B{{timestamp_widget_start}}
ms'%252Cmode%253Aabsolute%252Cto%253A'1970-01-01T00%253A00%253A00.000Z%25257C%25257C%25252B
{{timestamp_widget_end}}ms'))%2526_a%253D(columns%253A!(_source)%252Cfilters%253A!()%252Cindex
%253Abb-cloudtrail-view%252Cinterval%253Aauto%252Cquery%253A(language%253Akuery%252Cquery%253A'')
%252Csort%253A!()