graylog-api
Node.js module for Graylog2 API.All methods of this module compatitible with Graylog API v1.1.4 (59783f6). Search syntax look here: The search query language. For more detail you can look Graylog REST API browser: localhost:12900/api-browser.
Quick examples
var graylog = require('graylog-api');
var api = graylog.connect({
basicAuth: {
username: 'admin',
password: 'secret'
}, // Optional. Default: null. Basic access authentication
protocol: 'https', // Optional. Default: 'http'. Connection protocol
host: 'example.com', // Optional. Default: 'localhost'. API hostname
port: '12900', // Optional. Default: '12900'. API port
path: '/api' // Optional. Default: ''. API Path
});
api.searchAbsolute({ // parameters
query: 'source:apache',
from: '2015-07-24T00:00:00.000Z',
to: '2015-07-25T00:00:00.000Z',
limit: '10',
fields: 'message,timestamp',
sort: 'asc'
}, function(err, data) { // callback
if (err) {
console.log(err);
} else {
console.log(data);
}
});
updateUserPassword({ // parameters
old_password: 'secret',
password: 'qwerty123'
}, { // path
username: 'admin'
}, function (err, data) { // callback
if (err) {
console.log(err);
} else {
console.log(data);
}
});
api.getSystem(function(err, data) { // only callback
if (!err) {
console.log(data);
}
});
Download
The source is available for download from GitHub. Alternatively, you can install using Node Package Manager (npm
):npm install graylog-api
Documentation
API object expression has the same this syntax:api.[methodName]([parameters][, path][, callback]);
methodName
- The method nameparameters
- Object of method to be passed to the API serverpath
- Optional object of method to be replace path variablescallback
- Optional function to be call it after receive api data. First argument is object of error (null
if no errors), second - data
Methods
AlarmCallbacks: Manage stream alarm callbacks
getAlarmCallbacks
createAlarmCallback
getAlarmCallbacksAvailable
getAlarmCallback
updateAlarmCallback
removeAlarmCallback
AlertConditions: Manage stream alert conditions
AlertReceivers: Manage stream alert receivers
Alerts: Manage stream alerts
Counts: Message counts
Dashboards: Manage dashboards
createDashboard
getDashboards
getDashboard
updateDashboard
removeDashboard
updateDashboardPositions
createDashboardWidget
updateDashboardWidget
removeDashboardWidget
updateDashboardWidgetCacheTime
updateDashboardWidgetDescription
getDashboardWidgetValue
Extractors: Extractors of an input
createInputExtractor
getInputExtractors
updateInputExtractorOrder
updateInputExtractor
removeInputExtractor
getInputExtractor
Filters: Message blacklist filters
createBlacklistFilter
getBlacklistFilters
getBlacklistFilter
updateBlacklistFilter
removeBlacklistFilter
Indexer/Cluster: Indexer cluster information
Indexer/Failures: Indexer failures
Indexer/Indices: Index information
Messages: Single messages
Search/Absolute: Message search
searchAbsolute
searchAbsoluteFieldHistogram
searchAbsoluteHistogram
searchAbsoluteStats
searchAbsoluteTerms
searchAbsoluteTermsStats
Search/Keyword: Message search
searchKeyword
searchKeywordFieldHistogram
searchKeywordHistogram
searchKeywordStats
searchKeywordTerms
searchKeywordTermsStats
Search/Relative: Message search
searchRelative
searchRelativeFieldHistogram
searchRelativeHistogram
searchRelativeStats
searchRelativeTerms
searchRelativeTermsStats
Search/Saved: Saved searches
Sources: Listing message sources (e.g. hosts sending logs)
StaticFields: Static fields of an input
StreamOutputs: Manage stream outputs for a given stream
StreamRules: Manage stream rules
Streams: Manage streams
getStreams
createStream
getStreamsEnabled
getStreamThroughput
getStreamAllThroughput
getStream
updateStream
removeStream
cloneStream
pauseStream
resumeStream
testMatchStream
System: System information of this node
System/Buffers: Buffer information of this node.
System/Bundles: Content packs
System/Cluster: Node discovery
System/ClusterStats: Cluster stats
System/Collectors: Management of Graylog Collectors
System/Collectors/Registration: Registration resource for Graylog Collector nodes
System/Debug/Events: For debugging local and cluster events.
System/Deflector: Index deflector management
System/Fields: Get list of message fields that exist.
System/Grok: Manage grok patterns
System/IndexRanges: Index timeranges
System/Inputs: Message inputs of this node
System/Inputs/Types: Message input types of this node
System/Jobs: System Jobs
System/Journal: Message journal information of this node.
System/LDAP: LDAP settings
System/LoadBalancers: Status propagation for load balancers
System/Loggers: Internal Graylog loggers
System/Messages: Internal Graylog messages
System/Metrics: Internal Graylog2 metrics
System/Metrics/History: Get history of metrics
System/Notifications: Notifications generated by the system
System/Outputs: Manage outputs
System/Permissions: Retrieval of system permissions
System/Plugin: Plugin information
System/Processing: System processing status control
System/Radios: Management of graylog2-radio nodes
System/ServiceManager: ServiceManager Status
System/Sessions: Login for interactive user sessions
System/Shutdown: Shutdown this node gracefully
System/Stats: Node system stats
System/Throughput: Message throughput of this node
Users: User accounts
getUser
getUsers
createUser
updateUser
removeUser
updateUserPassword
updateUserPermissions
removeUserPermissions
updateUserPreferences
getUserTokens
createUserToken
removeUserToken
AlarmCallbacks: Manage stream alarm callbacks
getAlarmCallbacks(parameters, path, callback)
Get a list of all alarm callbacks for this streamArguments: parameters: {null} path: {Object}
* __streamid__: {String} The id of the stream whose alarm callbacks we want
callback: {Function} Optional. Callback functioncreateAlarmCallback(parameters, path, callback)
Create an alarm callbackArguments: parameters: {Object} {CreateAlarmCallbackRequest} path: {Object}
* __streamid__: {String} The stream id this new alarm callback belongs to
callback: {Function} Optional. Callback functiongetAlarmCallbacksAvailable(parameters, path, callback)
Get a list of all alarm callback typesArguments: parameters: {null} path: {Object}
* __streamid__: {String} The id of the stream whose alarm callbacks we want
callback: {Function} Optional. Callback functiongetAlarmCallback(parameters, path, callback)
Get a single specified alarm callback for this streamArguments: parameters: {null} path: {Object}
* __streamid__: {String} The id of the stream whose alarm callbacks we want
* __alarmCallbackId__: {String} The alarm callback id we are getting
callback: {Function} Optional. Callback functionupdateAlarmCallback(parameters, path, callback)
Update an alarm callbackArguments: parameters: {Object} {Map} path: {Object}
* __streamid__: {String} The stream id this alarm callback belongs to
* __alarmCallbackId__: {String}
callback: {Function} Optional. Callback functionremoveAlarmCallback(parameters, path, callback)
Delete an alarm callbackArguments: parameters: {null} path: {Object}
* __streamid__: {String} The stream id this alarm callback belongs to
* __alarmCallbackId__: {String}
callback: {Function} Optional. Callback functionAlertConditions: Manage stream alert conditions
createAlertCondition(parameters, path, callback)
Create an alert conditionArguments: parameters: {Object} {CreateConditionRequest} path: {Object}
* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functiongetAlertConditions(parameters, path, callback)
Get all alert conditions of this streamArguments: parameters: {null} path: {Object}
* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functionupdateAlertCondition(parameters, path, callback)
Modify an alert conditionArguments: parameters: {Object} {CreateConditionRequest} path: {Object}
* __streamId__: {String} The stream id the alert condition belongs to
* __conditionId__: {String} The alert condition id
callback: {Function} Optional. Callback functionremoveAlertCondition(parameters, path, callback)
Delete an alert conditionArguments: parameters: {null} path: {Object}
* __streamId__: {String} The stream id this new alert condition belongs to
* __conditionId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functionAlertReceivers: Manage stream alert receivers
getAlerts(parameters, path, callback)
Get the 300 most recent alarms of this streamArguments: parameters: {Object}
* _since_: {Integer} Optional. Optional parameter to define a lower date boundary. (UNIX timestamp)
path: {Object}* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functiongetAlertsCheck(parameters, path, callback)
Check for triggered alert conditions of this streams. Results cached for 30 secondsArguments: parameters: {null} path: {Object}
* __streamId__: {String} The ID of the stream to check
callback: {Function} Optional. Callback functioncreateAlertReceiver(parameters, path, callback)
Add an alert receiverArguments: parameters: {Object}
* __entity__: {String} Name/ID of user or email address to add as alert receiver
* __type__: {String} Type: users or emails
path: {Object}* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functionremoveAlertReceiver(parameters, path, callback)
Remove an alert receiverArguments: parameters: {Object}
* __type__: {String} Type: users or emails
* __entity__: {String} Name/ID of user or email address to remove from alert receivers
path: {Object}* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functiontestAlertSendDummy(parameters, path, callback)
Send a test mail for a given streamArguments: parameters: {null} path: {Object}
* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functionAlerts: Manage stream alerts
getAlerts(parameters, path, callback)
Get the 300 most recent alarms of this streamArguments: parameters: {Object}
* _since_: {Integer} Optional. Optional parameter to define a lower date boundary. (UNIX timestamp)
path: {Object}* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functiongetAlertsCheck(parameters, path, callback)
Check for triggered alert conditions of this streams. Results cached for 30 secondsArguments: parameters: {null} path: {Object}
* __streamId__: {String} The ID of the stream to check
callback: {Function} Optional. Callback functioncreateAlertReceiver(parameters, path, callback)
Add an alert receiverArguments: parameters: {Object}
* __type__: {String} Type: users or emails
* __entity__: {String} Name/ID of user or email address to add as alert receiver
path: {Object}* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functionremoveAlertReceiver(parameters, path, callback)
Remove an alert receiverArguments: parameters: {Object}
* __type__: {String} Type: users or emails
* __entity__: {String} Name/ID of user or email address to remove from alert receivers
path: {Object}* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functiontestAlertSendDummy(parameters, path, callback)
Send a test mail for a given streamArguments: parameters: {null} path: {Object}
* __streamId__: {String} The stream id this new alert condition belongs to
callback: {Function} Optional. Callback functionCounts: Message counts
getCountTotal(callback)
Total number of messages in all your indicesArguments: callback: {Function} Optional. Callback function
Dashboards: Manage dashboards
createDashboard(parameters, callback)
Create a dashboardArguments: parameters: {Object} {CreateDashboardRequest} callback: {Function} Optional. Callback function
getDashboards(callback)
Get a list of all dashboards and all configurations of their widgetsArguments: callback: {Function} Optional. Callback function
getDashboard(parameters, path, callback)
Get a single dashboards and all configurations of its widgetsArguments: parameters: {null} path: {Object}
* __dashboardId__: {String}
callback: {Function} Optional. Callback functionupdateDashboard(parameters, path, callback)
Update the settings of a dashboardArguments: parameters: {Object} {UpdateDashboardRequest} path: {Object}
* __dashboardId__: {String}
callback: {Function} Optional. Callback functionremoveDashboard(parameters, path, callback)
Delete a dashboard and all its widgetsArguments: parameters: {null} path: {Object}
* __dashboardId__: {String}
callback: {Function} Optional. Callback functionupdateDashboardPositions(parameters, path, callback)
Update/set the positions of dashboard widgetsArguments: parameters: {Object} {WidgetPositionsRequest} path: {Object}
* __dashboardId__: {String}
callback: {Function} Optional. Callback functioncreateDashboardWidget(parameters, path, callback)
Add a widget to a dashboardArguments: parameters: {Object} {AddWidgetRequest} path: {Object}
* __dashboardId__: {String}
callback: {Function} Optional. Callback functionupdateDashboardWidget(parameters, path, callback)
Update a widgetArguments: parameters: {Object} {AddWidgetRequest} path: {Object}
* __dashboardId__: {String}
* __widgetId__: {String}
callback: {Function} Optional. Callback functionremoveDashboardWidget(parameters, path, callback)
Delete a widgetArguments: parameters: {null} path: {Object}
* __dashboardId__: {String}
* __widgetId__: {String}
callback: {Function} Optional. Callback functionupdateDashboardWidgetCacheTime(parameters, path, callback)
Update cache time of a widgetArguments: parameters: {Object} {UpdateWidgetRequest} path: {Object}
* __dashboardId__: {String}
* __widgetId__: {String}
callback: {Function} Optional. Callback functionupdateDashboardWidgetDescription(parameters, path, callback)
Update description of a widgetArguments: parameters: {Object} {UpdateWidgetRequest} path: {Object}
* __dashboardId__: {String}
* __widgetId__: {String}
callback: {Function} Optional. Callback functiongetDashboardWidgetValue(parameters, path, callback)
Get a single widget valueArguments: parameters: {null} path: {Object}
* __dashboardId__: {String}
* __widgetId__: {String}
callback: {Function} Optional. Callback functionExtractors: Extractors of an input
createInputExtractor(parameters, path, callback)
Add an extractor to an inputArguments: parameters: {Object} {CreateExtractorRequest} path: {Object}
* __inputId__: {String}
callback: {Function} Optional. Callback functiongetInputExtractors(parameters, path, callback)
List all extractors of an inputArguments: parameters: {null} path: {Object}
* __inputId__: {String}
callback: {Function} Optional. Callback functionupdateInputExtractorOrder(parameters, path, callback)
Update extractor order of an inputArguments: parameters: {Object} {OrderExtractorsRequest} path: {Object}
* __inputId__: {String} Persist ID (!) of input
callback: {Function} Optional. Callback functionupdateInputExtractor(parameters, path, callback)
Update an extractorArguments: parameters: {Object} {CreateExtractorRequest} path: {Object}
* __inputId__: {String}
* __extractorId__: {String}
callback: {Function} Optional. Callback functionremoveInputExtractor(parameters, path, callback)
Delete an extractorArguments: parameters: {null} path: {Object}
* __inputId__: {String}
* __extractorId__: {String}
callback: {Function} Optional. Callback functiongetInputExtractor(parameters, path, callback)
Get information of a single extractor of an inputArguments: parameters: {null} path: {Object}
* __inputId__: {String}
* __extractorId__: {String}
callback: {Function} Optional. Callback functionFilters: Message blacklist filters
createBlacklistFilter(parameters, callback)
Create a blacklist filterIt can take up to a second until the change is applied
Arguments: parameters: {Object}
* __filterEntry__: {FilterDescription}
callback: {Function} Optional. Callback functiongetBlacklistFilters(callback)
Get all blacklist filtersArguments: callback: {Function} Optional. Callback function
getBlacklistFilter(parameters, path, callback)
Get the existing blacklist filterArguments: parameters: {null} path: {Object}
* __filterId__: {String}
callback: {Function} Optional. Callback functionupdateBlacklistFilter(parameters, path, callback)
Update an existing blacklist filterIt can take up to a second until the change is applied
Arguments: parameters: {Object}
* __filterEntry__: {FilterDescription}
path: {Object}* __filterId__: {String}
callback: {Function} Optional. Callback functionremoveBlacklistFilter(parameters, path, callback)
Remove the existing blacklist filterIt can take up to a second until the change is applied
Arguments: parameters: {null} path: {Object}
* __filterId__: {String}
callback: {Function} Optional. Callback functionIndexer/Cluster: Indexer cluster information
getClusterHealth(callback)
Get cluster and shard health overviewArguments: callback: {Function} Optional. Callback function
getClusterName(callback)
Get the cluster nameArguments: callback: {Function} Optional. Callback function
Indexer/Failures: Indexer failures
getSystemFailures(parameters, callback)
Get a list of failed index operationsArguments: parameters: {Object}
* __limit__: {Integer} Limit
* __offset__: {Integer} Offset
callback: {Function} Optional. Callback functiongetFailuresCount(parameters, callback)
Total count of failed index operations since the given dateArguments: parameters: {Object}
* __since__: {String} ISO8601 date
callback: {Function} Optional. Callback functionIndexer/Indices: Index information
getIndicesClosed(callback)
Get a list of closed indices that can be reopenedArguments: callback: {Function} Optional. Callback function
getIndicesReopened(callback)
Get a list of reopened indices, which will not be cleaned by retention cleaningArguments: callback: {Function} Optional. Callback function
removeIndex(parameters, path, callback)
Delete an index. This will also trigger an index ranges rebuild jobArguments: parameters: {null} path: {Object}
* _index_: {String} Optional.
callback: {Function} Optional. Callback functiongetIndices(parameters, path, callback)
Get information of an index and its shardsArguments: parameters: {null} path: {Object}
* _index_: {String} Optional.
callback: {Function} Optional. Callback functioncloseIndex(parameters, path, callback)
Close an index. This will also trigger an index ranges rebuild jobArguments: parameters: {null} path: {Object}
* _index_: {String} Optional.
callback: {Function} Optional. Callback functionreopenIndex(parameters, path, callback)
Reopen a closed index. This will also trigger an index ranges rebuild jobArguments: parameters: {null} path: {Object}
* _index_: {String} Optional.
callback: {Function} Optional. Callback functionMessages: Single messages
analyzeMessage(parameters, path, callback)
Analyze a message stringReturns what tokens/terms a message string (message or fullmessage) is split to
Arguments: parameters: {Object}
* __string__: {String} The string to analyze
path: {Object}* __index__: {String} The index the message containing the string is stored in
callback: {Function} Optional. Callback functiongetMessage(parameters, path, callback)
Get a single messageArguments: parameters: {null} path: {Object}
* __index__: {String} The index this message is stored in
* __messageId__: {String}
callback: {Function} Optional. Callback functionSearch/Absolute: Message search
searchAbsolute(parameters, callback)
Message search with absolute timerangeSearch for messages using an absolute timerange, specified as from/to with format yyyy-MM-ddTHH:mm:ss.SSSZ (e.g. 2014-01-23T15:34:49.000Z) or yyyy-MM-dd HH:mm:ss
Arguments: parameters: {Object}
* __query__: {String} Query (Lucene syntax)
* __from__: {String} Timerange start. See description for date format
* __to__: {String} Timerange end. See description for date format
* _limit_: {Integer} Optional. Maximum number of messages to return
* _offset_: {Integer} Optional. Offset
* _filter_: {String} Optional. Filter
* __fields__: {String} Comma separated list of fields to return
callback: {Function} Optional. Callback functionsearchAbsoluteFieldHistogram(parameters, callback)
Field value histogram of a query using an absolute timerangeArguments: parameters: {Object}
* __query__: {String} Query (Lucene syntax)
* __field__: {String} Field of whose values to get the histogram of
* __interval__: {String} Histogram interval / bucket size. (year, quarter, month, week, day, hour or minute)
* __from__: {String} Timerange start. See search method description for date format
* __to__: {String} Timerange end. See search method description for date format
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchAbsoluteHistogram(parameters, callback)
Datetime histogram of a query using an absolute timerangeArguments: parameters: {Object}
* __query__: {String} Query (Lucene syntax)
* __interval__: {String} Histogram interval / bucket size. (year, quarter, month, week, day, hour or minute)
* __from__: {String} Timerange start. See search method description for date format
* __to__: {String} Timerange end. See search method description for date format
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchAbsoluteStats(parameters, callback)
Field statistics for a query using an absolute timerangeReturns statistics like min/max or standard deviation of numeric fields over the whole query result set
Arguments: parameters: {Object}
* __field__: {String} Message field of numeric type to return statistics for
* __query__: {String} Query (Lucene syntax)
* __from__: {String} Timerange start. See search method description for date format
* __to__: {String} Timerange end. See search method description for date format
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchAbsoluteTerms(parameters, callback)
Most common field terms of a query using an absolute timerangeArguments: parameters: {Object}
* __field__: {String} Message field of to return terms of
* __query__: {String} Query (Lucene syntax)
* _size_: {Integer} Optional. Maximum number of terms to return
* __from__: {String} Timerange start. See search method description for date format
* __to__: {String} Timerange end. See search method description for date format
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchAbsoluteTermsStats(parameters, callback)
Ordered field terms of a query computed on another field using an absolute timerangeArguments: parameters: {Object}
* __key_field__: {String} Message field of to return terms of
* __value_field__: {String} Value field used for computation
* __order__: {String} What to order on (Allowed values: TERM, REVERSE_TERM, COUNT, REVERSE_COUNT, TOTAL, REVERSE_TOTAL, MIN, REVERSE_MIN, MAX, REVERSE_MAX, MEAN, REVERSE_MEAN)
* __query__: {String} Query (Lucene syntax)
* _size_: {Integer} Optional. Maximum number of terms to return
* __from__: {String} Timerange start. See search method description for date format
* __to__: {String} Timerange end. See search method description for date format
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionSearch/Keyword: Message search
searchKeyword(parameters, callback)
Message search with keyword as timerangeSearch for messages in a timerange defined by a keyword like "yesterday" or "2 weeks ago to wednesday"
Arguments: parameters: {Object}
* __query__: {String} Query (Lucene syntax)
* __keyword__: {String} Range keyword
* _limit_: {Integer} Optional. Maximum number of messages to return
* _offset_: {Integer} Optional. Offset
* _filter_: {String} Optional. Filter
* _fields_: {String} Optional. Comma separated list of fields to return
* _sort_: {String} Optional. Sorting (field:asc / field:desc)
callback: {Function} Optional. Callback functionsearchKeywordFieldHistogram(parameters, callback)
Datetime histogram of a query using keyword timerangeArguments: parameters: {Object}
* __query__: {String} Query (Lucene syntax)
* __field__: {String} Field of whose values to get the histogram of
* __interval__: {String} Histogram interval / bucket size. (year, quarter, month, week, day, hour or minute)
* __keyword__: {String} Range keyword
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchKeywordHistogram(parameters, callback)
Datetime histogram of a query using keyword timerangeArguments: parameters: {Object}
* __query__: {String} Query (Lucene syntax)
* __interval__: {String} Histogram interval / bucket size. (year, quarter, month, week, day, hour or minute)
* __keyword__: {String} Range keyword
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchKeywordStats(parameters, callback)
Field statistics for a query using a keyword timerangeReturns statistics like min/max or standard deviation of numeric fields over the whole query result set
Arguments: parameters: {Object}
* __field__: {String} Message field of numeric type to return statistics for
* __query__: {String} Query (Lucene syntax)
* __keyword__: {String} Range keyword
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchKeywordTerms(parameters, callback)
Most common field terms of a query using a keyword timerangeArguments: parameters: {Object}
* __field__: {String} Message field of to return terms of
* __query__: {String} Query (Lucene syntax)
* _size_: {Integer} Optional. Maximum number of terms to return
* __keyword__: {String} Range keyword
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchKeywordTermsStats(parameters, callback)
Ordered field terms of a query computed on another field using a keyword timerangeArguments: parameters: {Object}
* __key_field__: {String} Message field of to return terms of
* __value_field__: {String} Value field used for computation
* __order__: {String} What to order on (Allowed values: TERM, REVERSE_TERM, COUNT, REVERSE_COUNT, TOTAL, REVERSE_TOTAL, MIN, REVERSE_MIN, MAX, REVERSE_MAX, MEAN, REVERSE_MEAN)
* __query__: {String} Query (Lucene syntax)
* _size_: {Integer} Optional. Maximum number of terms to return
* __keyword__: {String} Keyword timeframe
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionSearch/Relative: Message search
searchRelative(parameters, callback)
Message search with relative timerangeSearch for messages in a relative timerange, specified as seconds from now. Example: 300 means search from 5 minutes ago to now
Arguments: parameters: {Object}
* __query__: {String} Query (Lucene syntax)
* __range__: {Integer} Relative timeframe to search in. See method description
* _limit_: {Integer} Optional. Maximum number of messages to return
* _offset_: {Integer} Optional. Offset
* _filter_: {String} Optional. Filter
* __fields__: {String} Comma separated list of fields to return
callback: {Function} Optional. Callback functionsearchRelativeFieldHistogram(parameters, callback)
Field value histogram of a query using a relative timerangeArguments: parameters: {Object}
* __query__: {String} Query (Lucene syntax)
* __field__: {String} Field of whose values to get the histogram of
* __interval__: {String} Histogram interval / bucket size. (year, quarter, month, week, day, hour or minute)
* __range__: {Integer} Relative timeframe to search in. See search method description
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchRelativeHistogram(parameters, callback)
Datetime histogram of a query using a relative timerangeArguments: parameters: {Object}
* __query__: {String} Query (Lucene syntax)
* __interval__: {String} Histogram interval / bucket size. (year, quarter, month, week, day, hour or minute)
* __range__: {Integer} Relative timeframe to search in. See search method description
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchRelativeStats(parameters, callback)
Field statistics for a query using a relative timerangeReturns statistics like min/max or standard deviation of numeric fields over the whole query result set
Arguments: parameters: {Object}
* __field__: {String} Message field of numeric type to return statistics for
* __query__: {String} Query (Lucene syntax)
* __range__: {Integer} Relative timeframe to search in. See search method description
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchRelativeTerms(parameters, callback)
Most common field terms of a query using a relative timerangeArguments: parameters: {Object}
* __field__: {String} Message field of to return terms of
* __query__: {String} Query (Lucene syntax)
* _size_: {Integer} Optional. Maximum number of terms to return
* __range__: {Integer} Relative timeframe to search in. See search method description
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionsearchRelativeTermsStats(parameters, callback)
Ordered field terms of a query computed on another field using a relative timerangeArguments: parameters: {Object}
* __key_field__: {String} Message field of to return terms of
* __value_field__: {String} Value field used for computation
* __order__: {String} What to order on (Allowed values: TERM, REVERSE_TERM, COUNT, REVERSE_COUNT, TOTAL, REVERSE_TOTAL, MIN, REVERSE_MIN, MAX, REVERSE_MAX, MEAN, REVERSE_MEAN)
* __query__: {String} Query (Lucene syntax)
* _size_: {Integer} Optional. Maximum number of terms to return
* __range__: {Integer} Relative timeframe to search in. See search method description
* _filter_: {String} Optional. Filter
callback: {Function} Optional. Callback functionSearch/Saved: Saved searches
createSearchSaved(parameters, callback)
Create a new saved searchArguments: parameters: {Object} {CreateSavedSearchRequest} callback: {Function} Optional. Callback function
getSearchSavedAll(callback)
Get a list of all saved searchesArguments: callback: {Function} Optional. Callback function
getSearchSaved(parameters, path, callback)
Get a single saved searchArguments: parameters: {null} path: {Object}
* __searchId__: {String}
callback: {Function} Optional. Callback functionupdateSearchSaved(parameters, path, callback)
Update a saved searchArguments: parameters: {Object} {CreateSavedSearchRequest} path: {Object}
* __searchId__: {String}
callback: {Function} Optional. Callback functionremoveSearchSaved(parameters, path, callback)
Delete a saved searchArguments: parameters: {null} path: {Object}
* __searchId__: {String}
callback: {Function} Optional. Callback functionSources: Listing message sources (e.g. hosts sending logs)
getSources(parameters, callback)
Get a list of all sources (not more than 5000) that have messages in the current indices. The result is cached for 10 secondsRange: The parameter is in seconds relative to the current time. 86400 means "in the last day", 0 is special and means "across all indices"
Arguments: parameters: {Object}
* __range__: {Integer} Relative timeframe to search in. See method description
callback: {Function} Optional. Callback functionStaticFields: Static fields of an input
createInputStaticField(parameters, path, callback)
Add a static field to an inputArguments: parameters: {Object} {CreateStaticFieldRequest} path: {Object}
* __inputId__: {String}
callback: {Function} Optional. Callback functionremoveInputStaticField(parameters, path, callback)
Remove static field of an inputArguments: parameters: {null} path: {Object}
* __Key__: {String}
* __inputId__: {String}
callback: {Function} Optional. Callback functionStreamOutputs: Manage stream outputs for a given stream
createStreamOutput(parameters, path, callback)
Associate outputs with a streamArguments: parameters: {Object} {AddOutputRequest} path: {Object}
* __streamid__: {String} The id of the stream whose outputs we want
callback: {Function} Optional. Callback functiongetStreamOutputs(parameters, path, callback)
Associate outputs with a streamArguments: parameters: {null} path: {Object}
* __streamid__: {String} The id of the stream whose outputs we want
callback: {Function} Optional. Callback functiongetStreamOutput(parameters, path, callback)
Get specific output of a streamArguments: parameters: {null} path: {Object}
* __streamid__: {String} The id of the stream whose outputs we want
callback: {Function} Optional. Callback functionremoveStreamOutput(parameters, path, callback)
Delete output of a streamArguments: parameters: {null} path: {Object}
* __streamid__: {String} The id of the stream whose outputs we want
* __outputId__: {String} The id of the output that should be deleted
callback: {Function} Optional. Callback functionStreamRules: Manage stream rules
getStreamRules(parameters, path, callback)
Get a list of all stream rulesArguments: parameters: {null} path: {Object}
* __streamid__: {String} The id of the stream whose stream rule we want
callback: {Function} Optional. Callback functiongetStreamRule(parameters, path, callback)
Get a single stream rulesArguments: parameters: {null} path: {Object}
* __streamid__: {String} The id of the stream whose stream rule we want
* __streamRuleId__: {String} The stream rule id we are getting
callback: {Function} Optional. Callback functioncreateStreamRule(parameters, path, callback)
Create a stream ruleArguments: parameters: {Object} {CreateStreamRuleRequest} path: {Object}
* __streamid__: {String} The stream id this new rule belongs to
callback: {Function} Optional. Callback functionupdateStreamRule(parameters, path, callback)
Update a stream ruleArguments: parameters: {Object} {CreateStreamRuleRequest} path: {Object}
* __streamid__: {String} The stream id this rule belongs to
* __streamRuleId__: {String} The stream rule id we are updating
callback: {Function} Optional. Callback functionremoveStreamRule(parameters, path, callback)
Delete a stream ruleArguments: parameters: {null} path: {Object}
* __streamid__: {String} The stream id this new rule belongs to
* __streamRuleId__: {String}
callback: {Function} Optional. Callback functionStreams: Manage streams
getStreams(callback)
Get a list of all streamsArguments: callback: {Function} Optional. Callback function
createStream(parameters, callback)
Create a streamArguments: parameters: {Object} {CreateStreamRequest} callback: {Function} Optional. Callback function
getStreamsEnabled(callback)
Get a list of all enabled streamsArguments: callback: {Function} Optional. Callback function
getStreamThroughput(parameters, path, callback)
Current throughput of this stream on this node in messages per secondArguments: parameters: {null} path: {Object}
* __streamId__: {String}
callback: {Function} Optional. Callback functiongetStreamAllThroughput(callback)
Current throughput of all visible streams on this node in messages per secondArguments: callback: {Function} Optional. Callback function
getStream(parameters, path, callback)
Get a single streamArguments: parameters: {null} path: {Object}
* __streamId__: {String}
callback: {Function} Optional. Callback functionupdateStream(parameters, path, callback)
Update a streamArguments: parameters: {Object} {UpdateStreamRequest} path: {Object}
* __streamId__: {String}
callback: {Function} Optional. Callback functionremoveStream(parameters, path, callback)
Delete a streamArguments: parameters: {null} path: {Object}
* __streamId__: {String}
callback: {Function} Optional. Callback functioncloneStream(parameters, path, callback)
Clone a streamArguments: parameters: {Object} {CloneStreamRequest} path: {Object}
* __streamId__: {String}
callback: {Function} Optional. Callback functionpauseStream(parameters, path, callback)
Pause a streamArguments: parameters: {null} path: {Object}
* __streamId__: {String}
callback: {Function} Optional. Callback functionresumeStream(parameters, path, callback)
Resume a streamArguments: parameters: {null} path: {Object}
* __streamId__: {String}
callback: {Function} Optional. Callback functiontestMatchStream(parameters, path, callback)
Test matching of a stream against a supplied messageArguments: parameters: {Object} {Map} path: {Object}
* __streamId__: {String}
callback: {Function} Optional. Callback functionSystem: System information of this node
getSystem(callback)
Get system overviewArguments: callback: {Function} Optional. Callback function
getJVM(callback)
Get JVM informationArguments: callback: {Function} Optional. Callback function
getThreadDump(callback)
Get a thread dumpArguments: callback: {Function} Optional. Callback function
System/Buffers: Buffer information of this node.
getBuffers(callback)
Get current utilization of buffers and caches of this nodeArguments: callback: {Function} Optional. Callback function
getBuffersClasses(callback)
Get classnames of current buffer implementationsArguments: callback: {Function} Optional. Callback function
System/Bundles: Content packs
createBundle(parameters, callback)
Upload a content packArguments: parameters: {Object}
* __Request__ body {ConfigurationBundle} Content pack
callback: {Function} Optional. Callback functiongetBundles(callback)
List available content packsArguments: callback: {Function} Optional. Callback function
exportBundles(parameters, callback)
Export entities as a content packArguments: parameters: {Object}
* __exportBundle__: {ExportBundle} Export content pack
callback: {Function} Optional. Callback functiongetBundle(parameters, path, callback)
Show content packArguments: parameters: {null} path: {Object}
* __bundleId__: {String} Content pack ID
callback: {Function} Optional. Callback functionupdateBundle(parameters, path, callback)
Update content packArguments: parameters: {Object}
* __Request__ body {ConfigurationBundle} Content pack
path: {Object}* __bundleId__: {String} Content pack ID
callback: {Function} Optional. Callback functionremoveBundle(parameters, path, callback)
Delete content packArguments: parameters: {null} path: {Object}
* __bundleId__: {String} Content pack ID
callback: {Function} Optional. Callback functionapplyBundle(parameters, path, callback)
Set up entities described by content packArguments: parameters: {null} path: {Object}
* __bundleId__: {String} Content pack ID
callback: {Function} Optional. Callback functionSystem/Cluster: Node discovery
getNodeThis(callback)
Information about this nodeThis de itself to get system information
Arguments: callback: {Function} Optional. Callback function
getNodes(parameters, path, callback)
List all active nodes in this clusterArguments: parameters: {null} path: {Object}
* __nodeId__: {String}
callback: {Function} Optional. Callback functiongetNode(parameters, path, callback)
Information about a nodeThis is returning information of a node in context to its state in the cluster. Use the system API of the node itself to get system information
Arguments: parameters: {null} path: {Object}
* __nodeId__: {String}
callback: {Function} Optional. Callback functionSystem/ClusterStats: Cluster stats
getClusterStats(callback)
Cluster snformationThis resource returns information about the Graylog cluster
Arguments: callback: {Function} Optional. Callback function
getClusterStatsElasticsearch(callback)
Elasticsearch informationThis resource returns information about the Elasticsearch Cluster
Arguments: callback: {Function} Optional. Callback function
getClusterStatsMongo(callback)
MongoDB informationThis aut MongoDB
Arguments: callback: {Function} Optional. Callback function
System/Collectors: Management of Graylog Collectors
getSystemCollectors(callback)
Lists all existing collector registrationsArguments: callback: {Function} Optional. Callback function
getSystemCollector(parameters, path, callback)
Returns at most one collector summary for the specified collector idArguments: parameters: {null} path: {Object}
* __collectorId__: {String}
callback: {Function} Optional. Callback functionSystem/Collectors/Registration: Registration resource for Graylog Collector nodes
changeCollector(parameters, path, callback)
Create/update an collector registrationThis is a stateless method which upserts a collector registration
Arguments: parameters: {Object} {CollectorRegistrationRequest} path: {Object}
* __collectorId__: {String} The collector id this collector is registering as
callback: {Function} Optional. Callback functionSystem/Debug/Events: For debugging local and cluster events.
createDebugEventsCluster(parameters, callback)
Create and send a cluster debug eventArguments: parameters: {Object}
* _text_: {String} Optional.
callback: {Function} Optional. Callback functiongetDebugEventsCluster(callback)
Show last received cluster debug eventArguments: callback: {Function} Optional. Callback function
createDebugEventsLocal(parameters, callback)
Create and send a local debug eventArguments: parameters: {Object}
* _text_: {String} Optional.
callback: {Function} Optional. Callback functiongetDebugEventsLocal(callback)
Show last received local debug eventArguments: callback: {Function} Optional. Callback function
System/Deflector: Index deflector management
getDeflector(callback)
Get current deflector statusArguments: callback: {Function} Optional. Callback function
getDeflectorConfig(callback)
Get deflector configuration. Only available on master nodesArguments: callback: {Function} Optional. Callback function
nextDeflectorCycle(callback)
Cycle deflector to new/next indexArguments: callback: {Function} Optional. Callback function
System/Fields: Get list of message fields that exist.
getFields(parameters, callback)
Get list of message fields that existThis operation is comparably fast because it reads directly from the indexer mapping
Arguments: parameters: {Object}
* _limit_: {Integer} Optional. Maximum number of fields to return. Set to 0 for all fields
callback: {Function} Optional. Callback functionSystem/Grok: Manage grok patterns
getGroks(callback)
Get all existing grok patternsArguments: callback: {Function} Optional. Callback function
getGrok(parameters, path, callback)
Get the existing grok patternArguments: parameters: {null} path: {Object}
* __patternId__: {String}
callback: {Function} Optional. Callback functioncreateGrok(parameters, callback)
Add a new named patternArguments: parameters: {Object}
* __pattern__: {GrokPatternSummary}
callback: {Function} Optional. Callback functioncreateGroks(parameters, callback)
Update an existing patternArguments: parameters: {Object}
* __patterns__: {Array}
callback: {Function} Optional. Callback functionupdateGrok(parameters, path, callback)
Update an existing patternArguments: parameters: {Object}
* __pattern__: {GrokPatternSummary}
path: {Object}* __patternId__: {String}
callback: {Function} Optional. Callback functionremoveGrok(callback)
Remove an existing pattern by idArguments: callback: {Function} Optional. Callback function
System/IndexRanges: Index timeranges
getIndicesRanges(callback)
Get a list of all index rangesArguments: callback: {Function} Optional. Callback function
rebuildIndicesRanges(callback)
Rebuild/sync index range informationThis as in what timeranges. It atomically overwrites already existing meta information
Arguments: callback: {Function} Optional. Callback function
System/Inputs: Message inputs of this node
createInput(parameters, callback)
Launch input on this nodeArguments: parameters: {Object} {InputLaunchRequest} callback: {Function} Optional. Callback function
getInput(null, path, callback)
Get information of a single input on this nodeArguments: parameters: {null} path: {Object}
* __inputId__: {String}
callback: {Function} Optional. Callback functiongetInputs(callback)
Get all inputs of this nodeArguments: callback: {Function} Optional. Callback function
updateInput(parameters, path, callback)
Update input on this nodeArguments: parameters: {Object} {InputLaunchRequest} path: {Object}
* __inputId__: {String}
callback: {Function} Optional. Callback functionremoveInput(parameters, path, callback)
Terminate input on this nodeArguments: parameters: {null} path: {Object}
* __inputId__: {String}
callback: {Function} Optional. Callback functionlaunchInput(parameters, path, callback)
Launch existing input on this nodeArguments: parameters: {null} path: {Object}
* __inputId__: {String}
callback: {Function} Optional. Callback functionrestartInput(parameters, path, callback)
Restart existing input on this nodeArguments: parameters: {null} path: {Object}
* __inputId__: {String}
callback: {Function} Optional. Callback functionstopInput(parameters, path, callback)
Stop existing input on this nodeArguments: parameters: {null} path: {Object}
* __inputId__: {String}
callback: {Function} Optional. Callback functionSystem/Inputs/Types: Message input types of this node
getInputsType(parameters, path, callback)
Get information about a single input typeArguments: parameters: {null} path: {Object}
* __inputType__: {String}
callback: {Function} Optional. Callback functiongetInputsTypes(callback)
Get all available input types of this nodeArguments: callback: {Function} Optional. Callback function
System/Jobs: System Jobs
createJob(parameters, callback)
Trigger new jobArguments: parameters: {Object} {TriggerRequest} callback: {Function} Optional. Callback function
getJobs(callback)
List currently running jobsArguments: callback: {Function} Optional. Callback function
getJob(parameters, path, callback)
Get information of a specific currently running jobArguments: parameters: {null} path: {Object}
* __jobId__: {String}
callback: {Function} Optional. Callback functionSystem/Journal: Message journal information of this node.
getJournal(callback)
Get current state of the journal on this nodeArguments: callback: {Function} Optional. Callback function
System/LDAP: LDAP settings
getLDAPSettings(callback)
Get the LDAP configuration if it is configuredArguments: callback: {Function} Optional. Callback function
updateLDAPSettings(parameters, callback)
Update the LDAP configurationArguments: parameters: {Object} {LdapSettingsRequest} callback: {Function} Optional. Callback function
removeLDAPSettings(callback)
Remove the LDAP configurationArguments: callback: {Function} Optional. Callback function
testLDAPSettings(parameters, callback)
Test LDAP ConfigurationArguments: parameters: {Object}
* __Configuration__ to test {LdapTestConfigRequest}
callback: {Function} Optional. Callback functionSystem/LoadBalancers: Status propagation for load balancers
getLoadBalancerStatus(callback)
Get status of this graylog2-server node for load balancers. Returns either ALIVE with HTTP 200 or DEAD with HTTP 503Arguments: callback: {Function} Optional. Callback function