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 = ;var api = graylog; api; ; api;
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:
apimethodNameparameters 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 stream
Arguments:
- parameters: {null}
- path: {Object}
- streamid: {String} The id of the stream whose alarm callbacks we want
- callback: {Function} Optional. Callback function
Create an alarm callback
Arguments:
- parameters: {Object} {CreateAlarmCallbackRequest}
- path: {Object}
- streamid: {String} The stream id this new alarm callback belongs to
- callback: {Function} Optional. Callback function
Get a list of all alarm callback types
Arguments:
- parameters: {null}
- path: {Object}
- streamid: {String} The id of the stream whose alarm callbacks we want
- callback: {Function} Optional. Callback function
Get a single specified alarm callback for this stream
Arguments:
- 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 function
Update an alarm callback
Arguments:
- parameters: {Object} {Map}
- path: {Object}
- streamid: {String} The stream id this alarm callback belongs to
- alarmCallbackId: {String}
- callback: {Function} Optional. Callback function
Delete an alarm callback
Arguments:
- parameters: {null}
- path: {Object}
- streamid: {String} The stream id this alarm callback belongs to
- alarmCallbackId: {String}
- callback: {Function} Optional. Callback function
AlertConditions: Manage stream alert conditions ### createAlertCondition(parameters, path[, callback])
Create an alert condition
Arguments:
- parameters: {Object} {CreateConditionRequest}
- path: {Object}
- streamId: {String} The stream id this new alert condition belongs to
- callback: {Function} Optional. Callback function
Get all alert conditions of this stream
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String} The stream id this new alert condition belongs to
- callback: {Function} Optional. Callback function
Modify an alert condition
Arguments:
- 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 function
Delete an alert condition
Arguments:
- 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 function
AlertReceivers: Manage stream alert receivers ### getAlerts(parameters, path[, callback])
Get the 300 most recent alarms of this stream
Arguments:
- 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 function
Check for triggered alert conditions of this streams. Results cached for 30 seconds
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String} The ID of the stream to check
- callback: {Function} Optional. Callback function
Add an alert receiver
Arguments:
- 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 function
Remove an alert receiver
Arguments:
- 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 function
Send a test mail for a given stream
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String} The stream id this new alert condition belongs to
- callback: {Function} Optional. Callback function
Alerts: Manage stream alerts ### getAlerts(parameters, path[, callback])
Get the 300 most recent alarms of this stream
Arguments:
- 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 function
Check for triggered alert conditions of this streams. Results cached for 30 seconds
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String} The ID of the stream to check
- callback: {Function} Optional. Callback function
Add an alert receiver
Arguments:
- 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 function
Remove an alert receiver
Arguments:
- 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 function
Send a test mail for a given stream
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String} The stream id this new alert condition belongs to
- callback: {Function} Optional. Callback function
Counts: Message counts ### getCountTotal([callback])
Total number of messages in all your indices
Arguments:
- callback: {Function} Optional. Callback function
Dashboards: Manage dashboards ### createDashboard(parameters[, callback])
Create a dashboard
Arguments:
- parameters: {Object} {CreateDashboardRequest}
- callback: {Function} Optional. Callback function
Get a list of all dashboards and all configurations of their widgets
Arguments:
- callback: {Function} Optional. Callback function
Get a single dashboards and all configurations of its widgets
Arguments:
- parameters: {null}
- path: {Object}
- dashboardId: {String}
- callback: {Function} Optional. Callback function
Update the settings of a dashboard
Arguments:
- parameters: {Object} {UpdateDashboardRequest}
- path: {Object}
- dashboardId: {String}
- callback: {Function} Optional. Callback function
Delete a dashboard and all its widgets
Arguments:
- parameters: {null}
- path: {Object}
- dashboardId: {String}
- callback: {Function} Optional. Callback function
Update/set the positions of dashboard widgets
Arguments:
- parameters: {Object} {WidgetPositionsRequest}
- path: {Object}
- dashboardId: {String}
- callback: {Function} Optional. Callback function
Add a widget to a dashboard
Arguments:
- parameters: {Object} {AddWidgetRequest}
- path: {Object}
- dashboardId: {String}
- callback: {Function} Optional. Callback function
Update a widget
Arguments:
- parameters: {Object} {AddWidgetRequest}
- path: {Object}
- dashboardId: {String}
- widgetId: {String}
- callback: {Function} Optional. Callback function
Delete a widget
Arguments:
- parameters: {null}
- path: {Object}
- dashboardId: {String}
- widgetId: {String}
- callback: {Function} Optional. Callback function
Update cache time of a widget
Arguments:
- parameters: {Object} {UpdateWidgetRequest}
- path: {Object}
- dashboardId: {String}
- widgetId: {String}
- callback: {Function} Optional. Callback function
Update description of a widget
Arguments:
- parameters: {Object} {UpdateWidgetRequest}
- path: {Object}
- dashboardId: {String}
- widgetId: {String}
- callback: {Function} Optional. Callback function
Get a single widget value
Arguments:
- parameters: {null}
- path: {Object}
- dashboardId: {String}
- widgetId: {String}
- callback: {Function} Optional. Callback function
Extractors: Extractors of an input ### createInputExtractor(parameters, path[, callback])
Add an extractor to an input
Arguments:
- parameters: {Object} {CreateExtractorRequest}
- path: {Object}
- inputId: {String}
- callback: {Function} Optional. Callback function
List all extractors of an input
Arguments:
- parameters: {null}
- path: {Object}
- inputId: {String}
- callback: {Function} Optional. Callback function
Update extractor order of an input
Arguments:
- parameters: {Object} {OrderExtractorsRequest}
- path: {Object}
- inputId: {String} Persist ID (!) of input
- callback: {Function} Optional. Callback function
Update an extractor
Arguments:
- parameters: {Object} {CreateExtractorRequest}
- path: {Object}
- inputId: {String}
- extractorId: {String}
- callback: {Function} Optional. Callback function
Delete an extractor
Arguments:
- parameters: {null}
- path: {Object}
- inputId: {String}
- extractorId: {String}
- callback: {Function} Optional. Callback function
Get information of a single extractor of an input
Arguments:
- parameters: {null}
- path: {Object}
- inputId: {String}
- extractorId: {String}
- callback: {Function} Optional. Callback function
Filters: Message blacklist filters ### createBlacklistFilter(parameters[, callback])
Create a blacklist filter
It can take up to a second until the change is applied
Arguments:
- parameters: {Object}
- filterEntry: {FilterDescription}
- callback: {Function} Optional. Callback function
Get all blacklist filters
Arguments:
- callback: {Function} Optional. Callback function
Get the existing blacklist filter
Arguments:
- parameters: {null}
- path: {Object}
- filterId: {String}
- callback: {Function} Optional. Callback function
Update an existing blacklist filter
It can take up to a second until the change is applied
Arguments:
- parameters: {Object}
- filterEntry: {FilterDescription}
- path: {Object}
- filterId: {String}
- callback: {Function} Optional. Callback function
Remove the existing blacklist filter
It can take up to a second until the change is applied
Arguments:
- parameters: {null}
- path: {Object}
- filterId: {String}
- callback: {Function} Optional. Callback function
Indexer/Cluster: Indexer cluster information ### getClusterHealth([callback])
Get cluster and shard health overview
Arguments:
- callback: {Function} Optional. Callback function
Get the cluster name
Arguments:
- callback: {Function} Optional. Callback function
Indexer/Failures: Indexer failures ### getSystemFailures(parameters[, callback])
Get a list of failed index operations
Arguments:
- parameters: {Object}
- limit: {Integer} Limit
- offset: {Integer} Offset
- callback: {Function} Optional. Callback function
Total count of failed index operations since the given date
Arguments:
- parameters: {Object}
- since: {String} ISO8601 date
- callback: {Function} Optional. Callback function
Indexer/Indices: Index information ### getIndicesClosed([callback])
Get a list of closed indices that can be reopened
Arguments:
- callback: {Function} Optional. Callback function
Get a list of reopened indices, which will not be cleaned by retention cleaning
Arguments:
- callback: {Function} Optional. Callback function
Delete an index. This will also trigger an index ranges rebuild job
Arguments:
- parameters: {null}
- path: {Object}
- index: {String} Optional.
- callback: {Function} Optional. Callback function
Get information of an index and its shards
Arguments:
- parameters: {null}
- path: {Object}
- index: {String} Optional.
- callback: {Function} Optional. Callback function
Close an index. This will also trigger an index ranges rebuild job
Arguments:
- parameters: {null}
- path: {Object}
- index: {String} Optional.
- callback: {Function} Optional. Callback function
Reopen a closed index. This will also trigger an index ranges rebuild job
Arguments:
- parameters: {null}
- path: {Object}
- index: {String} Optional.
- callback: {Function} Optional. Callback function
Messages: Single messages ### analyzeMessage(parameters, path[, callback])
Analyze a message string
Returns what tokens/terms a message string (message or full_message) 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 function
Get a single message
Arguments:
- parameters: {null}
- path: {Object}
- index: {String} The index this message is stored in
- messageId: {String}
- callback: {Function} Optional. Callback function
Search/Absolute: Message search ### searchAbsolute(parameters[, callback])
Message search with absolute timerange
Search 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 function
Field value histogram of a query using an absolute timerange
Arguments:
- 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 function
Datetime histogram of a query using an absolute timerange
Arguments:
- 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 function
Field statistics for a query using an absolute timerange
Returns 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 function
Most common field terms of a query using an absolute timerange
Arguments:
- 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 function
Ordered field terms of a query computed on another field using an absolute timerange
Arguments:
- 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 function
Search/Keyword: Message search ### searchKeyword(parameters[, callback])
Message search with keyword as timerange
Search 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 function
Datetime histogram of a query using keyword timerange
Arguments:
- 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 function
Datetime histogram of a query using keyword timerange
Arguments:
- 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 function
Field statistics for a query using a keyword timerange
Returns 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 function
Most common field terms of a query using a keyword timerange
Arguments:
- 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 function
Ordered field terms of a query computed on another field using a keyword timerange
Arguments:
- 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 function
Search/Relative: Message search ### searchRelative(parameters[, callback])
Message search with relative timerange
Search 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 function
Field value histogram of a query using a relative timerange
Arguments:
- 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 function
Datetime histogram of a query using a relative timerange
Arguments:
- 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 function
Field statistics for a query using a relative timerange
Returns 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 function
Most common field terms of a query using a relative timerange
Arguments:
- 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 function
Ordered field terms of a query computed on another field using a relative timerange
Arguments:
- 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 function
Search/Saved: Saved searches ### createSearchSaved(parameters[, callback])
Create a new saved search
Arguments:
- parameters: {Object} {CreateSavedSearchRequest}
- callback: {Function} Optional. Callback function
Get a list of all saved searches
Arguments:
- callback: {Function} Optional. Callback function
Get a single saved search
Arguments:
- parameters: {null}
- path: {Object}
- searchId: {String}
- callback: {Function} Optional. Callback function
Update a saved search
Arguments:
- parameters: {Object} {CreateSavedSearchRequest}
- path: {Object}
- searchId: {String}
- callback: {Function} Optional. Callback function
Delete a saved search
Arguments:
- parameters: {null}
- path: {Object}
- searchId: {String}
- callback: {Function} Optional. Callback function
Sources: 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 seconds
Range: 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 function
StaticFields: Static fields of an input ### createInputStaticField(parameters, path[, callback])
Add a static field to an input
Arguments:
- parameters: {Object} {CreateStaticFieldRequest}
- path: {Object}
- inputId: {String}
- callback: {Function} Optional. Callback function
Remove static field of an input
Arguments:
- parameters: {null}
- path: {Object}
- Key: {String}
- inputId: {String}
- callback: {Function} Optional. Callback function
StreamOutputs: Manage stream outputs for a given stream ### createStreamOutput(parameters, path[, callback])
Associate outputs with a stream
Arguments:
- parameters: {Object} {AddOutputRequest}
- path: {Object}
- streamid: {String} The id of the stream whose outputs we want
- callback: {Function} Optional. Callback function
Associate outputs with a stream
Arguments:
- parameters: {null}
- path: {Object}
- streamid: {String} The id of the stream whose outputs we want
- callback: {Function} Optional. Callback function
Get specific output of a stream
Arguments:
- parameters: {null}
- path: {Object}
- streamid: {String} The id of the stream whose outputs we want
- callback: {Function} Optional. Callback function
Delete output of a stream
Arguments:
- 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 function
StreamRules: Manage stream rules ### getStreamRules(parameters, path[, callback])
Get a list of all stream rules
Arguments:
- parameters: {null}
- path: {Object}
- streamid: {String} The id of the stream whose stream rule we want
- callback: {Function} Optional. Callback function
Get a single stream rules
Arguments:
- 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 function
Create a stream rule
Arguments:
- parameters: {Object} {CreateStreamRuleRequest}
- path: {Object}
- streamid: {String} The stream id this new rule belongs to
- callback: {Function} Optional. Callback function
Update a stream rule
Arguments:
- 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 function
Delete a stream rule
Arguments:
- parameters: {null}
- path: {Object}
- streamid: {String} The stream id this new rule belongs to
- streamRuleId: {String}
- callback: {Function} Optional. Callback function
Streams: Manage streams ### getStreams([callback])
Get a list of all streams
Arguments:
- callback: {Function} Optional. Callback function
Create a stream
Arguments:
- parameters: {Object} {CreateStreamRequest}
- callback: {Function} Optional. Callback function
Get a list of all enabled streams
Arguments:
- callback: {Function} Optional. Callback function
Current throughput of this stream on this node in messages per second
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String}
- callback: {Function} Optional. Callback function
Current throughput of all visible streams on this node in messages per second
Arguments:
- callback: {Function} Optional. Callback function
Get a single stream
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String}
- callback: {Function} Optional. Callback function
Update a stream
Arguments:
- parameters: {Object} {UpdateStreamRequest}
- path: {Object}
- streamId: {String}
- callback: {Function} Optional. Callback function
Delete a stream
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String}
- callback: {Function} Optional. Callback function
Clone a stream
Arguments:
- parameters: {Object} {CloneStreamRequest}
- path: {Object}
- streamId: {String}
- callback: {Function} Optional. Callback function
Pause a stream
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String}
- callback: {Function} Optional. Callback function
Resume a stream
Arguments:
- parameters: {null}
- path: {Object}
- streamId: {String}
- callback: {Function} Optional. Callback function
Test matching of a stream against a supplied message
Arguments:
- parameters: {Object} {Map}
- path: {Object}
- streamId: {String}
- callback: {Function} Optional. Callback function
System: System information of this node ### getSystem([callback])
Get system overview
Arguments:
- callback: {Function} Optional. Callback function
Get JVM information
Arguments:
- callback: {Function} Optional. Callback function
Get a thread dump
Arguments:
- callback: {Function} Optional. Callback function
System/Buffers: Buffer information of this node. ### getBuffers([callback])
Get current utilization of buffers and caches of this node
Arguments:
- callback: {Function} Optional. Callback function
Get classnames of current buffer implementations
Arguments:
- callback: {Function} Optional. Callback function
System/Bundles: Content packs ### createBundle(parameters[, callback])
Upload a content pack
Arguments:
- parameters: {Object}
- Request body {ConfigurationBundle} Content pack
- callback: {Function} Optional. Callback function
List available content packs
Arguments:
- callback: {Function} Optional. Callback function
Export entities as a content pack
Arguments:
- parameters: {Object}
- exportBundle: {ExportBundle} Export content pack
- callback: {Function} Optional. Callback function
Show content pack
Arguments:
- parameters: {null}
- path: {Object}
- bundleId: {String} Content pack ID
- callback: {Function} Optional. Callback function
Update content pack
Arguments:
- parameters: {Object}
- Request body {ConfigurationBundle} Content pack
- path: {Object}
- bundleId: {String} Content pack ID
- callback: {Function} Optional. Callback function
Delete content pack
Arguments:
- parameters: {null}
- path: {Object}
- bundleId: {String} Content pack ID
- callback: {Function} Optional. Callback function
Set up entities described by content pack
Arguments:
- parameters: {null}
- path: {Object}
- bundleId: {String} Content pack ID
- callback: {Function} Optional. Callback function
System/Cluster: Node discovery ### getNodeThis([callback])
Information about this node
This de itself to get system information
Arguments:
- callback: {Function} Optional. Callback function
List all active nodes in this cluster
Arguments:
- parameters: {null}
- path: {Object}
- nodeId: {String}
- callback: {Function} Optional. Callback function
Information about a node
This 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 function
System/ClusterStats: Cluster stats ### getClusterStats([callback])
Cluster snformation
This resource returns information about the Graylog cluster
Arguments:
- callback: {Function} Optional. Callback function
Elasticsearch information
This resource returns information about the Elasticsearch Cluster
Arguments:
- callback: {Function} Optional. Callback function
MongoDB information
This aut MongoDB
Arguments:
- callback: {Function} Optional. Callback function
System/Collectors: Management of Graylog Collectors ### getSystemCollectors([callback])
Lists all existing collector registrations
Arguments:
- callback: {Function} Optional. Callback function
Returns at most one collector summary for the specified collector id
Arguments:
- parameters: {null}
- path: {Object}
- collectorId: {String}
- callback: {Function} Optional. Callback function
System/Collectors/Registration: Registration resource for Graylog Collector nodes ### changeCollector(parameters, path[, callback])
Create/update an collector registration
This 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 function
System/Debug/Events: For debugging local and cluster events. ### createDebugEventsCluster(parameters[, callback])
Create and send a cluster debug event
Arguments:
- parameters: {Object}
- text: {String} Optional.
- callback: {Function} Optional. Callback function
Show last received cluster debug event
Arguments:
- callback: {Function} Optional. Callback function
Create and send a local debug event
Arguments:
- parameters: {Object}
- text: {String} Optional.
- callback: {Function} Optional. Callback function
Show last received local debug event
Arguments:
- callback: {Function} Optional. Callback function
System/Deflector: Index deflector management ### getDeflector([callback])
Get current deflector status
Arguments:
- callback: {Function} Optional. Callback function
Get deflector configuration. Only available on master nodes
Arguments:
- callback: {Function} Optional. Callback function
Cycle deflector to new/next index
Arguments:
- callback: {Function} Optional. Callback function
System/Fields: Get list of message fields that exist. ### getFields(parameters[, callback])
Get list of message fields that exist
This 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 function
System/Grok: Manage grok patterns ### getGroks([callback])
Get all existing grok patterns
Arguments:
- callback: {Function} Optional. Callback function
Get the existing grok pattern
Arguments:
- parameters: {null}
- path: {Object}
- patternId: {String}
- callback: {Function} Optional. Callback function
Add a new named pattern
Arguments:
- parameters: {Object}
- pattern: {GrokPatternSummary}
- callback: {Function} Optional. Callback function
Update an existing pattern
Arguments:
- parameters: {Object}
- patterns: {Array}
- callback: {Function} Optional. Callback function
Update an existing pattern
Arguments:
- parameters: {Object}
- pattern: {GrokPatternSummary}
- path: {Object}
- patternId: {String}
- callback: {Function} Optional. Callback function
Remove an existing pattern by id
Arguments:
- callback: {Function} Optional. Callback function
System/IndexRanges: Index timeranges ### getIndicesRanges([callback])
Get a list of all index ranges
Arguments:
- callback: {Function} Optional. Callback function
Rebuild/sync index range information
This 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 node
Arguments:
- parameters: {Object} {InputLaunchRequest}
- callback: {Function} Optional. Callback function
Get information of a single input on this node
Arguments:
- parameters: {null}
- path: {Object}
- inputId: {String}
- callback: {Function} Optional. Callback function
Get all inputs of this node
Arguments:
- callback: {Function} Optional. Callback function
Update input on this node
Arguments:
- parameters: {Object} {InputLaunchRequest}
- path: {Object}
- inputId: {String}
- callback: {Function} Optional. Callback function
Terminate input on this node
Arguments:
- parameters: {null}
- path: {Object}
- inputId: {String}
- callback: {Function} Optional. Callback function
Launch existing input on this node
Arguments:
- parameters: {null}
- path: {Object}
- inputId: {String}
- callback: {Function} Optional. Callback function
Restart existing input on this node
Arguments:
- parameters: {null}
- path: {Object}
- inputId: {String}
- callback: {Function} Optional. Callback function
Stop existing input on this node
Arguments:
- parameters: {null}
- path: {Object}
- inputId: {String}
- callback: {Function} Optional. Callback function
System/Inputs/Types: Message input types of this node ### getInputsType(parameters, path[, callback])
Get information about a single input type
Arguments:
- parameters: {null}
- path: {Object}
- inputType: {String}
- callback: {Function} Optional. Callback function
Get all available input types of this node
Arguments:
- callback: {Function} Optional. Callback function
System/Jobs: System Jobs ### createJob(parameters[, callback])
Trigger new job
Arguments:
- parameters: {Object} {TriggerRequest}
- callback: {Function} Optional. Callback function
List currently running jobs
Arguments:
- callback: {Function} Optional. Callback function
Get information of a specific currently running job
Arguments:
- parameters: {null}
- path: {Object}
- jobId: {String}
- callback: {Function} Optional. Callback function
System/Journal: Message journal information of this node. ### getJournal([callback])
Get current state of the journal on this node
Arguments:
- callback: {Function} Optional. Callback function
System/LDAP: LDAP settings ### getLDAPSettings([callback])
Get the LDAP configuration if it is configured
Arguments:
- callback: {Function} Optional. Callback function
Update the LDAP configuration
Arguments:
- parameters: {Object} {LdapSettingsRequest}
- callback: {Function} Optional. Callback function
Remove the LDAP configuration
Arguments:
- callback: {Function} Optional. Callback function
Test LDAP Configuration
Arguments:
- parameters: {Object}
- Configuration to test {LdapTestConfigRequest}
- callback: {Function} Optional. Callback function
System/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 503
Arguments:
- callback: {Function} Optional. Callback function
Override load balancer status of this graylog2-server node. Next lifecycle change will override it again to its default. Set to ALIVE or DEAD
Arguments:
- parameters: {null}
- path: {Object}
- status: {String} Optional.
- callback: {Function} Optional. Callback function
System/Loggers: Internal Graylog loggers ### getLoggers([callback])
List all loggers and their current levels
Arguments:
- callback: {Function} Optional. Callback function
List all logger subsystems and their current levels
Arguments:
- callback: {Function} Optional. Callback function
Set the loglevel of a whole subsystem
Provided level is falling back to DEBUG if it does not exist
Arguments:
- parameters: {null}
- path: {Object}
- subsystem: {String}
- level: {String}
- callback: {Function} Optional. Callback function
Set the loglevel of a single logger
Provided level is falling back to DEBUG if it does not exist
Arguments:
- parameters: {null}
- path: {Object}
- loggerName: {String}
- level: {String}
- callback: {Function} Optional. Callback function
System/Messages: Internal Graylog messages ### getSystemMessages(parameters[, callback])
Get internal Graylog system messages
Arguments:
- parameters: {Object}
- page: {Integer} Optional. Page
- callback: {Function} Optional. Callback function
System/Metrics: Internal Graylog2 metrics ### getMetric(parameters, path[, callback])
Get a single metric
Arguments:
- parameters: {null}
- path: {Object}
- metricName: {String}
- callback: {Function} Optional. Callback function
Get all metrics
Arguments:
- callback: {Function} Optional. Callback function
Get the values of multiple metrics at once
Arguments:
- parameters: {Object}
- Requested metrics {MetricsReadRequest}
- callback: {Function} Optional. Callback function
Get all metrics keys/names
Arguments:
- callback: {Function} Optional. Callback function
Get all metrics of a namespace
Arguments:
- parameters: {null}
- path: {Object}
- namespace: {String}
- callback: {Function} Optional. Callback function
System/Metrics/History: Get history of metrics ### getMetricsHistory(parameters, path[, callback])
Get history of a single metric The maximum retention time is currently only 5 minutes
Arguments:
- parameters: {Object}
- after: {Long} Optional. Only values for after this UTC timestamp (1970 epoch)
- path: {Object}
- metricName: {String}
- callback: {Function} Optional. Callback function
System/Notifications: Notifications generated by the system ### getNotifications([callback])
Get all active notifications
Arguments:
- callback: {Function} Optional. Callback function
Delete a notification
Arguments:
- parameters: {null}
- path: {Object}
- notificationType: {String} Optional.
- callback: {Function} Optional. Callback function
System/Outputs: Manage outputs ### getOutput(parameters, path[, callback])
Get specific output
Arguments:
- parameters: {null}
- path: {Object}
- outputId: {String} The id of the output we want
- callback: {Function} Optional. Callback function
Get a list of all outputs
Arguments:
- callback: {Function} Optional. Callback function
Create an output
Arguments:
- parameters: {Object} {CreateOutputRequest}
- callback: {Function} Optional. Callback function
Get all available output modules
Arguments:
- callback: {Function} Optional. Callback function
Update output
Arguments:
- parameters: {Object} {Map}
- path: {Object}
- outputId: {String} The id of the output that should be deleted
- callback: {Function} Optional. Callback function
Delete output
Arguments:
- parameters: {null}
- path: {Object}
- outputId: {String} The id of the output that should be deleted
- callback: {Function} Optional. Callback function
System/Permissions: Retrieval of system permissions ### getPermissions([callback])
Get all available user permissions
Arguments:
- callback: {Function} Optional. Callback function
Get the initial permissions assigned to a reader account
Arguments:
- parameters: {null}
- path: {Object}
- username: {String}
- callback: {Function} Optional. Callback function
System/Plugin: Plugin information ### getSystemPlugins([callback])
List all installed plugins on this node
Arguments:
- callback: {Function} Optional. Callback function
System/Processing: System processing status control ### pauseSystemProcessing([callback])
Pauses message processing
Arguments:
- callback: {Function} Optional. Callback function
Resume message processing
Arguments:
- callback: {Function} Optional. Callback function
System/Radios: Management of graylog2-radio nodes ### getRadio(parameters, path[, callback])
Information about a radio
This is returning information of a radio 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}
- radioId: {String}
- callback: {Function} Optional. Callback function
List all active radios in this cluster
Arguments:
- callback: {Function} Optional. Callback function
Register input of a radio
Radio inputs register their own inputs here for persistence after they successfully launched it
Arguments:
- parameters: {Object} {RegisterInputRequest}
- path: {Object}
- radioId: {String}
- callback: {Function} Optional. Callback function
Persisted inputs of a radio
This is returning the configured persisted inputs of a radio node. This is not returning the actually running inputs on a radio node. Radio nodes use this resource to get their configured inputs on startup
Arguments:
- parameters: {null}
- path: {Object}
- radioId: {String}
- callback: {Function} Optional. Callback function
Unregister input of a radio
Radios unregister their inputs when they are stopped/terminated on the radio
Arguments:
- parameters: {null}
- path: {Object}
- radioId: {String}
- inputId: {String}
- callback: {Function} Optional. Callback function
Ping - Accepts pings of graylog2-radio nodes
Every graylog2-radio node is regularly pinging to announce that it is active
Arguments:
- parameters: {Object} {PingRequest}
- path: {Object}
- radioId: {String}
- callback: {Function} Optional. Callback function
System/ServiceManager: ServiceManager Status ### getServiceManager([callback])
List current status of ServiceManager
Arguments:
- callback: {Function} Optional. Callback function
System/Sessions: Login for interactive user sessions ### createSession(parameters[, callback])
This request creates a new session for a user or reactivates an existing session: the equivalent of logging in
Arguments:
- parameters: {Object}
- Login request {SessionCreateRequest} Username and credentials
- callback: {Function} Optional. Callback function
Terminate an existing session
Destroys the session with the given ID: the equivalent of logging out
Arguments:
- parameters: {null}
- path: {Object}
- sessionId: {String}
- callback: {Function} Optional. Callback function
System/Shutdown: Shutdown this node gracefully ### shutdownNode([callback])
Shutdown this node gracefully
Attempts at no new messages are accepted
Arguments:
- callback: {Function} Optional. Callback function
System/Stats: Node system stats ### getStats([callback])
System o this node
This resource returns information about the system this node is running on
Arguments:
- callback: {Function} Optional. Callback function
Filesystem o this node
This resource returns information about the filesystems of this node
Arguments:
- callback: {Function} Optional. Callback function
JVM information o this node
This resource returns information about the Java Virtual Machine of this node
Arguments:
- callback: {Function} Optional. Callback function
Networking o this node
This resource returns information about the networking system this node is running with
Arguments:
- callback: {Function} Optional. Callback function
OS information o this node
This resource returns information about the operating system this node is running on
Arguments:
- callback: {Function} Optional. Callback function
Process information about this node
This irunning as
Arguments:
- callback: {Function} Optional. Callback function
System/Throughput: Message throughput of this node ### getThroughput([callback])
Current throughput of this node in messages per second
Arguments:
- callback: {Function} Optional. Callback function
Users: User accounts ### getUser(parameters, path[, callback])
Get user details
The user's permissions are only included if a user asks for his own account or for users with the necessary permissions to edit permissions
Arguments:
- parameters: {null}
- path: {Object}
- username: {String} The username to return information for
- callback: {Function} Optional. Callback function
Lurs
The permissions assigned to the users are always included
Arguments:
- callback: {Function} Optional. Callback function
Create a new user account
Arguments:
- parameters: {Object} {CreateUserRequest} Must contain username, full_name, email, password and a list of permissionsteUserRequest'
- callback: {Function} Optional. Callback function
Modify user details
Arguments:
- parameters: {Object} {ChangeUserRequest} Updated user information
- path: {Object}
- username: {String} The name of the user to modify
- callback: {Function} Optional. Callback function
Removes a user account
Arguments:
- parameters: {null}
- path: {Object}
- username: {String} The name of the user to delete
- callback: {Function} Optional. Callback function
Update the password for a user
Arguments:
- parameters: {Object} {ChangePasswordRequest} The old and new passwords
- path: {Object}
- username: {String} The name of the user whose password to change
- callback: {Function} Optional. Callback function
Update a user's permission set
Arguments:
- parameters: {Object} {PermissionEditRequest} The list of permissions to assign to the user
- path: {Object}
- username: {String} The name of the user to modify
- callback: {Function} Optional. Callback function
Revoke all permissions for a user without deleting the account
Arguments:
- parameters: {null}
- path: {Object}
- username: {String} The name of the user to modify
- callback: {Function} Optional. Callback function
Update a user's preferences set
Arguments:
- parameters: {Object} {UpdateUserPreferences} The map of preferences to assign to the user
- path: {Object}
- username: {String} The name of the user to modify
- callback: {Function} Optional. Callback function
Retrieves the list of access tokens for a user
Arguments:
- parameters: {null}
- path: {Object}
- username: {String}
- callback: {Function} Optional. Callback function
Generates a new access token for a user
Arguments:
- parameters: {null}
- path: {Object}
- username: {String}
- name: {String} Descriptive name for this token (e.g. "cronjob")
- callback: {Function} Optional. Callback function
Removes a token for a user
Arguments:
- parameters: {null}
- path: {Object}
- username: {String}
- access: token {String}
- callback: {Function} Optional. Callback function
License
The MIT License (MIT)
Copyright (c) 2015 Andrii Kolomiichenko (bboywilld@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.