Scalyr

Wrapper

The scalyr() wrapper enables querying Scalyr from your AWS worker if the credentials have been specified for the worker instance(s). For more description of each type of query, please refer to https://www.scalyr.com/help/api .

count(query, minutes=5)

Run a count query against Scalyr, depending on number of queries you may run into rate limit.

scalyr().count(' ERROR ')
timeseries(query, minutes=30)

Runs a timeseries query against Scalyr with more generous rate limits. (New time series are created on the fly by Scalyr)

facets(filter, field, max_count=5, minutes=30, prio='low')

This method is used to retrieve the most common values for a field.

logs(query, max_count=100, minutes=5, continuation_token=None, columns=None)

Runs a query against Scalyr and returns logs that match the query. At most max_count log lines will be returned. More can be fetched with the same query by passing back the continuation_token from the last response into the logs method.

Specific columns can be returned (as defined in scalyr parser) using the columns array e.g. columns=['severity','threadName','timestamp']. If this is unspecified, only the message column will be returned.

An example logs result as JSON:

{
    "messages": [
       "message line 1",
       "message line 2"
    ],
    "continuation_token": "a token"
}

Custom Scalyr Region

By default the Scalyr wrapper uses https://www.scalyr.com/ as the default region. Overriding is possible using scalyr(scalyr_region='eu') if you want to use their Europe environment https://eu.scalyr.com/.

scalyr(scalyr_region='eu').count(' ERROR ')