
Research
npm Malware Targets Telegram Bot Developers with Persistent SSH Backdoors
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
graylog-api
Advanced tools
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.
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);
}
});
The source is available for download from
GitHub.
Alternatively, you can install using Node Package Manager (npm
):
npm install graylog-api
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 - datagetAlarmCallbacks
createAlarmCallback
getAlarmCallbacksAvailable
getAlarmCallback
updateAlarmCallback
removeAlarmCallback
createDashboard
getDashboards
getDashboard
updateDashboard
removeDashboard
updateDashboardPositions
createDashboardWidget
updateDashboardWidget
removeDashboardWidget
updateDashboardWidgetCacheTime
updateDashboardWidgetDescription
getDashboardWidgetValue
createInputExtractor
getInputExtractors
updateInputExtractorOrder
updateInputExtractor
removeInputExtractor
getInputExtractor
createBlacklistFilter
getBlacklistFilters
getBlacklistFilter
updateBlacklistFilter
removeBlacklistFilter
searchAbsolute
searchAbsoluteFieldHistogram
searchAbsoluteHistogram
searchAbsoluteStats
searchAbsoluteTerms
searchAbsoluteTermsStats
searchKeyword
searchKeywordFieldHistogram
searchKeywordHistogram
searchKeywordStats
searchKeywordTerms
searchKeywordTermsStats
searchRelative
searchRelativeFieldHistogram
searchRelativeHistogram
searchRelativeStats
searchRelativeTerms
searchRelativeTermsStats
getStreams
createStream
getStreamsEnabled
getStreamThroughput
getStreamAllThroughput
getStream
updateStream
removeStream
cloneStream
pauseStream
resumeStream
testMatchStream
getUser
getUsers
createUser
updateUser
removeUser
updateUserPassword
updateUserPermissions
removeUserPermissions
updateUserPreferences
getUserTokens
createUserToken
removeUserToken
Get a list of all alarm callbacks for this stream
Arguments:
Create an alarm callback
Arguments:
Get a list of all alarm callback types
Arguments:
Get a single specified alarm callback for this stream
Arguments:
Update an alarm callback
Arguments:
Delete an alarm callback
Arguments:
Create an alert condition
Arguments:
Get all alert conditions of this stream
Arguments:
Modify an alert condition
Arguments:
Delete an alert condition
Arguments:
Get the 300 most recent alarms of this stream
Arguments:
Check for triggered alert conditions of this streams. Results cached for 30 seconds
Arguments:
Add an alert receiver
Arguments:
Remove an alert receiver
Arguments:
Send a test mail for a given stream
Arguments:
Get the 300 most recent alarms of this stream
Arguments:
Check for triggered alert conditions of this streams. Results cached for 30 seconds
Arguments:
Add an alert receiver
Arguments:
Remove an alert receiver
Arguments:
Send a test mail for a given stream
Arguments:
Total number of messages in all your indices
Arguments:
Create a dashboard
Arguments:
Get a list of all dashboards and all configurations of their widgets
Arguments:
Get a single dashboards and all configurations of its widgets
Arguments:
Update the settings of a dashboard
Arguments:
Delete a dashboard and all its widgets
Arguments:
Update/set the positions of dashboard widgets
Arguments:
Add a widget to a dashboard
Arguments:
Update a widget
Arguments:
Delete a widget
Arguments:
Update cache time of a widget
Arguments:
Update description of a widget
Arguments:
Get a single widget value
Arguments:
Add an extractor to an input
Arguments:
List all extractors of an input
Arguments:
Update extractor order of an input
Arguments:
Update an extractor
Arguments:
Delete an extractor
Arguments:
Get information of a single extractor of an input
Arguments:
Create a blacklist filter
It can take up to a second until the change is applied
Arguments:
Get all blacklist filters
Arguments:
Get the existing blacklist filter
Arguments:
Update an existing blacklist filter
It can take up to a second until the change is applied
Arguments:
Remove the existing blacklist filter
It can take up to a second until the change is applied
Arguments:
Get cluster and shard health overview
Arguments:
Get the cluster name
Arguments:
Get a list of failed index operations
Arguments:
Total count of failed index operations since the given date
Arguments:
Get a list of closed indices that can be reopened
Arguments:
Get a list of reopened indices, which will not be cleaned by retention cleaning
Arguments:
Delete an index. This will also trigger an index ranges rebuild job
Arguments:
Get information of an index and its shards
Arguments:
Close an index. This will also trigger an index ranges rebuild job
Arguments:
Reopen a closed index. This will also trigger an index ranges rebuild job
Arguments:
Analyze a message string
Returns what tokens/terms a message string (message or full_message) is split to
Arguments:
Get a single message
Arguments:
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:
Field value histogram of a query using an absolute timerange
Arguments:
Datetime histogram of a query using an absolute timerange
Arguments:
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:
Most common field terms of a query using an absolute timerange
Arguments:
Ordered field terms of a query computed on another field using an absolute timerange
Arguments:
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:
Datetime histogram of a query using keyword timerange
Arguments:
Datetime histogram of a query using keyword timerange
Arguments:
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:
Most common field terms of a query using a keyword timerange
Arguments:
Ordered field terms of a query computed on another field using a keyword timerange
Arguments:
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:
Field value histogram of a query using a relative timerange
Arguments:
Datetime histogram of a query using a relative timerange
Arguments:
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:
Most common field terms of a query using a relative timerange
Arguments:
Ordered field terms of a query computed on another field using a relative timerange
Arguments:
Create a new saved search
Arguments:
Get a list of all saved searches
Arguments:
Get a single saved search
Arguments:
Update a saved search
Arguments:
Delete a saved search
Arguments:
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:
Add a static field to an input
Arguments:
Remove static field of an input
Arguments:
Associate outputs with a stream
Arguments:
Associate outputs with a stream
Arguments:
Get specific output of a stream
Arguments:
Delete output of a stream
Arguments:
Get a list of all stream rules
Arguments:
Get a single stream rules
Arguments:
Create a stream rule
Arguments:
Update a stream rule
Arguments:
Delete a stream rule
Arguments:
Get a list of all streams
Arguments:
Create a stream
Arguments:
Get a list of all enabled streams
Arguments:
Current throughput of this stream on this node in messages per second
Arguments:
Current throughput of all visible streams on this node in messages per second
Arguments:
Get a single stream
Arguments:
Update a stream
Arguments:
Delete a stream
Arguments:
Clone a stream
Arguments:
Pause a stream
Arguments:
Resume a stream
Arguments:
Test matching of a stream against a supplied message
Arguments:
Get system overview
Arguments:
Get JVM information
Arguments:
Get a thread dump
Arguments:
Get current utilization of buffers and caches of this node
Arguments:
Get classnames of current buffer implementations
Arguments:
Upload a content pack
Arguments:
List available content packs
Arguments:
Export entities as a content pack
Arguments:
Show content pack
Arguments:
Update content pack
Arguments:
Delete content pack
Arguments:
Set up entities described by content pack
Arguments:
Information about this node
This de itself to get system information
Arguments:
List all active nodes in this cluster
Arguments:
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:
Cluster snformation
This resource returns information about the Graylog cluster
Arguments:
Elasticsearch information
This resource returns information about the Elasticsearch Cluster
Arguments:
MongoDB information
This aut MongoDB
Arguments:
Lists all existing collector registrations
Arguments:
Returns at most one collector summary for the specified collector id
Arguments:
Create/update an collector registration
This is a stateless method which upserts a collector registration
Arguments:
Create and send a cluster debug event
Arguments:
Show last received cluster debug event
Arguments:
Create and send a local debug event
Arguments:
Show last received local debug event
Arguments:
Get current deflector status
Arguments:
Get deflector configuration. Only available on master nodes
Arguments:
Cycle deflector to new/next index
Arguments:
Get list of message fields that exist
This operation is comparably fast because it reads directly from the indexer mapping
Arguments:
Get all existing grok patterns
Arguments:
Get the existing grok pattern
Arguments:
Add a new named pattern
Arguments:
Update an existing pattern
Arguments:
Update an existing pattern
Arguments:
Remove an existing pattern by id
Arguments:
Get a list of all index ranges
Arguments:
Rebuild/sync index range information
This as in what timeranges. It atomically overwrites already existing meta information
Arguments:
Launch input on this node
Arguments:
Get information of a single input on this node
Arguments:
Get all inputs of this node
Arguments:
Update input on this node
Arguments:
Terminate input on this node
Arguments:
Launch existing input on this node
Arguments:
Restart existing input on this node
Arguments:
Stop existing input on this node
Arguments:
Get information about a single input type
Arguments:
Get all available input types of this node
Arguments:
Trigger new job
Arguments:
List currently running jobs
Arguments:
Get information of a specific currently running job
Arguments:
Get current state of the journal on this node
Arguments:
Get the LDAP configuration if it is configured
Arguments:
Update the LDAP configuration
Arguments:
Remove the LDAP configuration
Arguments:
Test LDAP Configuration
Arguments:
Get status of this graylog2-server node for load balancers. Returns either ALIVE with HTTP 200 or DEAD with HTTP 503
Arguments:
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:
List all loggers and their current levels
Arguments:
List all logger subsystems and their current levels
Arguments:
Set the loglevel of a whole subsystem
Provided level is falling back to DEBUG if it does not exist
Arguments:
Set the loglevel of a single logger
Provided level is falling back to DEBUG if it does not exist
Arguments:
Get internal Graylog system messages
Arguments:
Get a single metric
Arguments:
Get all metrics
Arguments:
Get the values of multiple metrics at once
Arguments:
Get all metrics keys/names
Arguments:
Get all metrics of a namespace
Arguments:
Get history of a single metric The maximum retention time is currently only 5 minutes
Arguments:
Get all active notifications
Arguments:
Delete a notification
Arguments:
Get specific output
Arguments:
Get a list of all outputs
Arguments:
Create an output
Arguments:
Get all available output modules
Arguments:
Update output
Arguments:
Delete output
Arguments:
Get all available user permissions
Arguments:
Get the initial permissions assigned to a reader account
Arguments:
List all installed plugins on this node
Arguments:
Pauses message processing
Arguments:
Resume message processing
Arguments:
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:
List all active radios in this cluster
Arguments:
Register input of a radio
Radio inputs register their own inputs here for persistence after they successfully launched it
Arguments:
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:
Unregister input of a radio
Radios unregister their inputs when they are stopped/terminated on the radio
Arguments:
Ping - Accepts pings of graylog2-radio nodes
Every graylog2-radio node is regularly pinging to announce that it is active
Arguments:
List current status of ServiceManager
Arguments:
This request creates a new session for a user or reactivates an existing session: the equivalent of logging in
Arguments:
Terminate an existing session
Destroys the session with the given ID: the equivalent of logging out
Arguments:
Shutdown this node gracefully
Attempts at no new messages are accepted
Arguments:
System o this node
This resource returns information about the system this node is running on
Arguments:
Filesystem o this node
This resource returns information about the filesystems of this node
Arguments:
JVM information o this node
This resource returns information about the Java Virtual Machine of this node
Arguments:
Networking o this node
This resource returns information about the networking system this node is running with
Arguments:
OS information o this node
This resource returns information about the operating system this node is running on
Arguments:
Process information about this node
This irunning as
Arguments:
Current throughput of this node in messages per second
Arguments:
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:
Lurs
The permissions assigned to the users are always included
Arguments:
Create a new user account
Arguments:
Modify user details
Arguments:
Removes a user account
Arguments:
Update the password for a user
Arguments:
Update a user's permission set
Arguments:
Revoke all permissions for a user without deleting the account
Arguments:
Update a user's preferences set
Arguments:
Retrieves the list of access tokens for a user
Arguments:
Generates a new access token for a user
Arguments:
Removes a token for a user
Arguments:
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.
FAQs
Node.js module for Graylog2 API
The npm package graylog-api receives a total of 52 weekly downloads. As such, graylog-api popularity was classified as not popular.
We found that graylog-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
Security News
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.