public abstract class

LogglyRetrieveConnector

extends Object
java.lang.Object
   ↳ org.mule.modules.loggly.LogglyRetrieveConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Logger Retrieve Module

CRUD of input and logging devices, retrieve and search previously logged messages from Loggly.

Summary

Constants
String BASE_URL
int TIMEOUT
Fields
private HttpClient httpClient REST Http Client
private static ObjectMapper objectMapper
private String password Loggly Password
private String subdomain Logging Subdomain
private String username Loggly Username
Public Constructors
LogglyRetrieveConnector()
Public Methods
abstract void addCurrentDevice(int id)
Add the current machine as a device to an existing input

abstract void addCurrentDeviceToSyslog514(int id)
Add the current machine with Syslog 514 UDP as a device to an existing input

abstract void addDevice(Integer id, String ip, String deviceName)
Adds a device to an input

void before()
abstract void createInput(String inputName, String description, Service service)
Create an input

abstract void deleteDevice(int id)
Deletes a Device from an Input

abstract void deleteDeviceByIp(String ip)
Deletes a Device (identified by an IP address) from an Input

abstract Device device(int id)
Get a device by id

abstract Collection<Device> devices()
Get all the Devices

abstract void disableInputDiscovery(int id)
Disables discovery mode on the device

abstract void enableInputDiscovery(int id)
Puts the Input in discovery mode

abstract LogglyFacetResult facet(String query, FacetType facetType, int buckets, String gap, String from, String until)
Provides faceted results from an account on either date, ip, or input fields.
HttpClient getHttpClient()
String getPassword()
String getSubdomain()
String getUsername()
abstract Input input(int id)
Fetch an input for an account using its id.
abstract Input inputByName(String inputName)
Fetch an input for an account using its name.
abstract Collection<Input> inputs()
Fetch all the inputs associated with the account.
abstract void removeDevice(int id)
Remove Device from Input

abstract LogglyResultSet search(String query, int rows, int start, String from, String until, Order order)
Searches for a log message.
void setPassword(String password)
void setSubdomain(String subdomain)
void setUsername(String username)
static Device transformJsonToDevice(String json)
Transform JSON to Device

static Collection<Device> transformJsonToDevices(String json)
Transform JSON to collection of Devices

static LogglyFacetResult transformJsonToFacetResult(String json)
Transform JSON to a Facet Search result

static Input transformJsonToInput(String json)
Transform JSON to Input

static Collection<Input> transformJsonToInputs(String json)
Transform JSON to collection of Inputs

static LogglyResultSet transformJsonToResultSet(String json)
Transform JSON to Result Set

Protected Methods
static <T> Collection<T> genericJsonToListTransformer(String json)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String BASE_URL

Constant Value: "https://{subdomain}.loggly.com/api/"

private static final int TIMEOUT

Constant Value: 7200 (0x00001c20)

Fields

private HttpClient httpClient

REST Http Client

private static ObjectMapper objectMapper

private String password

Loggly Password

private String subdomain

Logging Subdomain

private String username

Loggly Username

Public Constructors

public LogglyRetrieveConnector ()

Public Methods

public abstract void addCurrentDevice (int id)

Add the current machine as a device to an existing input

Parameters
id Input ID
Throws
Exception error while doing the request and receiving the response

public abstract void addCurrentDeviceToSyslog514 (int id)

Add the current machine with Syslog 514 UDP as a device to an existing input

Parameters
id Device ID
Returns
  • Input input
Throws
Exception error while doing the request and receiving the response

public abstract void addDevice (Integer id, String ip, String deviceName)

Adds a device to an input

Parameters
id Input ID where to attach the device
ip IP Address of the device
deviceName Name of the device
Throws
Exception error while doing the request and receiving the response

public void before ()

public abstract void createInput (String inputName, String description, Service service)

Create an input

Parameters
inputName Name
description Description
service Service to use
Throws
Exception error while doing the request and receiving the response

public abstract void deleteDevice (int id)

Deletes a Device from an Input

Parameters
id Device ID to remove
Throws
Exception error while doing the request and receiving the response

public abstract void deleteDeviceByIp (String ip)

Deletes a Device (identified by an IP address) from an Input

Parameters
ip IP Address of the Device to remove
Throws
Exception error while doing the request and receiving the response

public abstract Device device (int id)

Get a device by id

Parameters
id Device to retrieve
Returns
  • devices
Throws
Exception error while doing the request and receiving the response

public abstract Collection<Device> devices ()

Get all the Devices

Returns
  • devices
Throws
Exception error while doing the request and receiving the response

public abstract void disableInputDiscovery (int id)

Disables discovery mode on the device

Parameters
id Device ID
Returns
  • Input input
Throws
Exception error while doing the request and receiving the response

public abstract void enableInputDiscovery (int id)

Puts the Input in discovery mode

Parameters
id Device ID
Returns
  • Input input
Throws
Exception error while doing the request and receiving the response

public abstract LogglyFacetResult facet (String query, FacetType facetType, int buckets, String gap, String from, String until)

Provides faceted results from an account on either date, ip, or input fields. Facets return counts of events over a time range.

Parameters
query String to search in logs.
facetType Facet type to use.
buckets Number of buckets the results are split into for a given time range. Defaults to 50.
gap Set the gap time between buckets. Defaults to +1HOUR
from Start time for the search. Defaults to NOW-1HOUR.
until End time for the search. Defaults to NOW.
Returns
  • Facet results
Throws
Exception error while doing the request and receiving the response

public HttpClient getHttpClient ()

public String getPassword ()

public String getSubdomain ()

public String getUsername ()

public abstract Input input (int id)

Fetch an input for an account using its id. Without id

Parameters
id Id of the input
Returns
  • Input input
Throws
Exception error while doing the request and receiving the response

public abstract Input inputByName (String inputName)

Fetch an input for an account using its name.

Parameters
inputName Name of the input
Returns
  • Input input
Throws
Exception error while doing the request and receiving the response

public abstract Collection<Input> inputs ()

Fetch all the inputs associated with the account.

Returns
  • Input input
Throws
Exception error while doing the request and receiving the response

public abstract void removeDevice (int id)

Remove Device from Input

Parameters
id Device ID
Throws
Exception error while doing the request and receiving the response

public abstract LogglyResultSet search (String query, int rows, int start, String from, String until, Order order)

Searches for a log message.

Parameters
query String to search in logs.
rows Number of rows returned by search. Defaults to 10, maximum of 2000.
start Offset for starting row. Defaults to 0.
from Start time for the search. Defaults to NOW-24HOURS.
until End time for the search. Defaults to NOW.
order Direction of results returned, either 'asc' or 'desc'. Defaults to 'desc'.
Returns
  • Search results
Throws
Exception error while doing the request and receiving the response

public void setPassword (String password)

Parameters
password

public void setSubdomain (String subdomain)

Parameters
subdomain

public void setUsername (String username)

Parameters
username

public static Device transformJsonToDevice (String json)

Transform JSON to Device

Parameters
json JSON string to transform
Returns
Throws
IOException if the conversion fails

public static Collection<Device> transformJsonToDevices (String json)

Transform JSON to collection of Devices

Parameters
json JSON string to transform
Returns
  • A Collection
Throws
IOException if the conversion fails

public static LogglyFacetResult transformJsonToFacetResult (String json)

Transform JSON to a Facet Search result

Parameters
json JSON string to transform
Returns
Throws
IOException if the conversion fails

public static Input transformJsonToInput (String json)

Transform JSON to Input

Parameters
json JSON string to transform
Returns
Throws
IOException if the conversion fails

public static Collection<Input> transformJsonToInputs (String json)

Transform JSON to collection of Inputs

Parameters
json JSON string to transform
Returns
  • A java.util.Collection
Throws
IOException if the conversion fails

public static LogglyResultSet transformJsonToResultSet (String json)

Transform JSON to Result Set

Parameters
json JSON string to transform
Returns
Throws
IOException if the conversion fails

Protected Methods

protected static Collection<T> genericJsonToListTransformer (String json)

Parameters
json
Throws
IOException