search module

Provides SumoLogic search wrappers.

class hutch.security.sumologic.search.Client(access_id: str, access_key: str, api_url: str = 'https://api.sumologic.com/api')[source]

Bases: hutch.security.sumologic.base.Client

Provides a SumoLogic search client.

messages(job_id: str) Iterable[hutch.security.sumologic.models.SearchJobMessage][source]

Yields messages until there are none left.

Parameters

job_id – The search job identifier to return messages for.

query(query: str, start: datetime.datetime, end: datetime.datetime, timeout: int = 600, interval: int = 10) hutch.security.sumologic.models.SearchJob[source]

Syncronously execute a query and return the results.

Parameters
  • query – A search query to execute.

  • start – A date stamp to constrain the query (from).

  • end – A date stamp to constrain the query (to).

  • timeout – The maximum duration to wait for results from the API, in seconds.

  • interval – The time to wait between requests to the API to check query status, in seconds.

Returns

Search metadata.

records(job_id: str) Iterable[hutch.security.sumologic.models.SearchJobRecord][source]

Yields records until there are none left.

Parameters

job_id – The search job identifier to return records for.