Forwarders

Forwarders

The Forwarder:

Forwarders are the main way to get data into LogHarvestor.

Ownership:

Forwarders are owned by projects, which are owned by organizations. This means that you can have multiple forwarders per project, and multiple projects per organization.

Security:

Forwarders are assigned tokens that are used to authenticate with the LogHarvestor API. The tokens only allow the forwarder to send data to the LogHarvestor API, and do not allow the forwarder to read any data from the LogHarvestor API. Tokens are generated when the forwarders is created, and can be regenerated at any time. For more information about authentication, see the authentication documentation.

Get all

Description


Fetch all forwarders that the user has access to.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

Responses


Type:

Array of Forwarder objects


Example:

1
2
3
4
5
6
7
8
9
10
11
12
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Web server 1",
    notes: "Forwarder assigned to the web server",
    host: "10.10.10.100",
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
    enabled: true,
    org: "0f9c0b0b4f0c6b0017f0e3b1",
    project: "0f9c0b0b4f0c6b0017f0e3b1",
    createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
    tot_logs: 10000
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

get

/forwarder/

Request

1
2
3
4
curl https://logharvestor.com/api/v1/forwarder/ \
    -X GET \
    -H 'Authorization: Bearer <token>' \
    

Response

1
2
3
4
5
6
7
8
9
10
11
12
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Web server 1",
    notes: "Forwarder assigned to the web server",
    host: "10.10.10.100",
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
    enabled: true,
    org: "0f9c0b0b4f0c6b0017f0e3b1",
    project: "0f9c0b0b4f0c6b0017f0e3b1",
    createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
    tot_logs: 10000
}

Get by id

Description


Find the forwarder that matches the {forwarderId} query parameter.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

params

forwarderId

string

Required

Description:

Forwarder identifier

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

Responses


Type:

Forwarder object


Example:

1
2
3
4
5
6
7
8
9
10
11
12
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Web server 1",
    notes: "Forwarder assigned to the web server",
    host: "10.10.10.100",
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
    enabled: true,
    org: "0f9c0b0b4f0c6b0017f0e3b1",
    project: "0f9c0b0b4f0c6b0017f0e3b1",
    createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
    tot_logs: 10000
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

get

/forwarder/:forwarderId

Request

1
2
3
4
curl https://logharvestor.com/api/v1/forwarder/:forwarderId \
    -X GET \
    -H 'Authorization: Bearer <token>' \
    

Response

1
2
3
4
5
6
7
8
9
10
11
12
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Web server 1",
    notes: "Forwarder assigned to the web server",
    host: "10.10.10.100",
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
    enabled: true,
    org: "0f9c0b0b4f0c6b0017f0e3b1",
    project: "0f9c0b0b4f0c6b0017f0e3b1",
    createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
    tot_logs: 10000
}

Get events

Description


Get all events that the forwarder has generated. These events are generated when the forwarder is created, updated, enabled, or deleted.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

params

forwarderId

string

Required

Description:

Forwarder identifier

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

Responses


Description:

Returns all events for the forwarder.


Type:

Array of Event objects


Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "updated",
    message: "User 0f9c0b0b4f0c6b0017f0e3b1 updated forwarder 0f9c0b0b4f0c6b0017f0e3b1",
    user: "0f9c0b0b4f0c6b0017f0e3b1",
    entity: "0f9c0b0b4f0c6b0017f0e3b1",
    entityType: "Forwarder",
    refs: [
        {
            entity: "0f9c0b0b4f0c6b0017f0e3b1",
            entityType: "Forwarder"
        },
        {
            entity: "0f9c0b0b4f0c6b0017f0e3b1",
            entityType: "Project"
        }
    ]
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

get

/forwarder/:forwarderId/events

Request

1
2
3
4
curl https://logharvestor.com/api/v1/forwarder/:forwarderId/events \
    -X GET \
    -H 'Authorization: Bearer <token>' \
    

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "updated",
    message: "User 0f9c0b0b4f0c6b0017f0e3b1 updated forwarder 0f9c0b0b4f0c6b0017f0e3b1",
    user: "0f9c0b0b4f0c6b0017f0e3b1",
    entity: "0f9c0b0b4f0c6b0017f0e3b1",
    entityType: "Forwarder",
    refs: [
        {
            entity: "0f9c0b0b4f0c6b0017f0e3b1",
            entityType: "Forwarder"
        },
        {
            entity: "0f9c0b0b4f0c6b0017f0e3b1",
            entityType: "Project"
        }
    ]
}

Get notifications

Description


Get all notifications settings configured for the forwarder.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

params

forwarderId

string

Required

Description:

Forwarder identifier

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

Responses


Description:

Returns all notifications for the forwarder.


Type:

Array of Notification objects


Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Error notification",
    notes: "This notification is for errors",
    ownerEntityType: "User",
    ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
    rules: {
        id: "0f9c0b0b4f0c6b0017f0e3b1",
        field: "typ",
        operator: "EQUALS",
        comparator: "error",
        combinator: "AND"
    },
    mediums: {
        email: true,
        sms: true,
        push: true
    },
    enabled: true
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

get

/forwarder/:forwarderId/notifications

Request

1
2
3
4
curl https://logharvestor.com/api/v1/forwarder/:forwarderId/notifications \
    -X GET \
    -H 'Authorization: Bearer <token>' \
    

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Error notification",
    notes: "This notification is for errors",
    ownerEntityType: "User",
    ownerEntity: "0f9c0b0b4f0c6b0017f0e3b1",
    rules: {
        id: "0f9c0b0b4f0c6b0017f0e3b1",
        field: "typ",
        operator: "EQUALS",
        comparator: "error",
        combinator: "AND"
    },
    mediums: {
        email: true,
        sms: true,
        push: true
    },
    enabled: true
}

Get stats

Description


Get all stats for the forwarder. This includes things like total logs, logs over time by type, total logs by type, etc.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

params

forwarderId

string

Required

Description:

Forwarder identifier

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

Responses


Description:

Returns the stats for the forwarder.


Type:

ForwarderStats object


Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
    logLine: {
        data: [
            {
                _id: "error",
                data: [
                    {
                        _id: "168910405000",
                        count: 578
                    },
                    {
                        _id: "168910415000",
                        count: 253
                    },
                    {
                        _id: "168910425000",
                        count: 0
                    }
                ]
            },
            {
                _id: "info",
                data: [
                    {
                        _id: "168910405000",
                        count: 1202
                    },
                    {
                        _id: "168910415000",
                        count: 1353
                    },
                    {
                        _id: "168910425000",
                        count: 5539
                    }
                ]
            }
        ]
    },
    logPie: {
        data: [
            {
                _id: "error",
                count: 20053
            },
            {
                _id: "info",
                count: 1220028
            }
        ]
    }
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

get

/forwarder/:forwarderId/stats

Request

1
2
3
4
curl https://logharvestor.com/api/v1/forwarder/:forwarderId/stats \
    -X GET \
    -H 'Authorization: Bearer <token>' \
    

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
    logLine: {
        data: [
            {
                _id: "error",
                data: [
                    {
                        _id: "168910405000",
                        count: 578
                    },
                    {
                        _id: "168910415000",
                        count: 253
                    },
                    {
                        _id: "168910425000",
                        count: 0
                    }
                ]
            },
            {
                _id: "info",
                data: [
                    {
                        _id: "168910405000",
                        count: 1202
                    },
                    {
                        _id: "168910415000",
                        count: 1353
                    },
                    {
                        _id: "168910425000",
                        count: 5539
                    }
                ]
            }
        ]
    },
    logPie: {
        data: [
            {
                _id: "error",
                count: 20053
            },
            {
                _id: "info",
                count: 1220028
            }
        ]
    }
}

Create

Description


Create a new forwarder.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

body

name

string

Required

Description:

Forwarder name

Example:

"Web server 1"

host

string

Required

Description:

Forwarder host

Example:

"10.10.10.100"

notes

string

Description:

Forwarder notes

Example:

"Forwarder assigned to the web server"

org

string

Required

Description:

Forwarder organization

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

project

string

Required

Description:

Forwarder project

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

enabled

boolean

Required

Description:

Forwarder enabled

Example:

true

Responses


Type:

Forwarder object


Example:

1
2
3
4
5
6
7
8
9
10
11
12
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Web server 1",
    notes: "Forwarder assigned to the web server",
    host: "10.10.10.100",
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
    enabled: true,
    org: "0f9c0b0b4f0c6b0017f0e3b1",
    project: "0f9c0b0b4f0c6b0017f0e3b1",
    createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
    tot_logs: 10000
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

post

/forwarder/

Request

1
2
3
4
5
curl https://logharvestor.com/api/v1/forwarder/ \
    -X POST \
    -H 'Authorization: Bearer <token>' \
    -H 'Content-Type: application/json' \
	--data-raw '{"name":"\"Web server 1\"","host":"\"10.10.10.100\"","notes":"\"Forwarder assigned to the web server\"","org":"\"0f9c0b0b4f0c6b0017f0e3b1\"","project":"\"0f9c0b0b4f0c6b0017f0e3b1\""}'

Response

1
2
3
4
5
6
7
8
9
10
11
12
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Web server 1",
    notes: "Forwarder assigned to the web server",
    host: "10.10.10.100",
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
    enabled: true,
    org: "0f9c0b0b4f0c6b0017f0e3b1",
    project: "0f9c0b0b4f0c6b0017f0e3b1",
    createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
    tot_logs: 10000
}

Update

Description


Update a forwarder. Note that the token can only be updated by generating a new token.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

params

forwarderId

string

Required

Description:

Forwarder identifier

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

body

name

string

Required

Description:

Forwarder name

Example:

"Web server 1"

host

string

Required

Description:

Forwarder host

Example:

"10.10.10.100"

notes

string

Description:

Forwarder notes

Example:

"Forwarder assigned to the web server"

org

string

Required

Description:

Forwarder organization

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

project

string

Required

Description:

Forwarder project

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

enabled

boolean

Required

Description:

Forwarder enabled

Example:

true

Responses


Description:

Returns the updated [forwarder](/docs/api/forwarders).


Type:

Forwarder object


Example:

1
2
3
4
5
6
7
8
9
10
11
12
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Web server 1",
    notes: "Forwarder assigned to the web server",
    host: "10.10.10.100",
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
    enabled: true,
    org: "0f9c0b0b4f0c6b0017f0e3b1",
    project: "0f9c0b0b4f0c6b0017f0e3b1",
    createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
    tot_logs: 10000
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

put

/forwarder/:forwarderId

Request

1
2
3
4
5
curl https://logharvestor.com/api/v1/forwarder/:forwarderId \
    -X PUT \
    -H 'Authorization: Bearer <token>' \
    -H 'Content-Type: application/json' \
	--data-raw '{"name":"\"Web server 1\"","host":"\"10.10.10.100\"","notes":"\"Forwarder assigned to the web server\"","org":"\"0f9c0b0b4f0c6b0017f0e3b1\"","project":"\"0f9c0b0b4f0c6b0017f0e3b1\""}'

Response

1
2
3
4
5
6
7
8
9
10
11
12
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    name: "Web server 1",
    notes: "Forwarder assigned to the web server",
    host: "10.10.10.100",
    token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
    enabled: true,
    org: "0f9c0b0b4f0c6b0017f0e3b1",
    project: "0f9c0b0b4f0c6b0017f0e3b1",
    createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
    tot_logs: 10000
}

Delete

Description


Delete a card.

  • This will permanently a forwarder and all associated data.
  • A successful response will return a snapshot of the forwarder before it was deleted.
  • If the forwarder is already deleted, a 404 will be returned.
  • Associated data that will be deleted includes: Events, Notifications & Stats
  • Logs will not be deleted. But will no longer be indexed by attributes of the forwarder.
  • ⚠️ WARNING ⚠️

  • This action cannot be undone.
  • If you do not want to permanently delete the forwarder, consider archiving it instead.
  • Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    forwarderId

    string

    Required

    Description:

    Forwarder identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns a snapshot of the forwarder before it was deleted.


    Type:

    Forwarder object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    delete

    /forwarder/:forwarderId

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/forwarder/:forwarderId \
        -X DELETE \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Archive

    Description


    Archive a forwarder. Archived forwarders cannot send logs even if they are enabled.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    forwarderId

    string

    Required

    Description:

    Forwarder identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the archived forwarder.


    Type:

    Forwarder object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /forwarder/:forwarderId/archive

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/forwarder/:forwarderId/archive \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Unarchive

    Description


    Unarchive a forwarder. Unarchived forwarders can send logs as long as they are enabled.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    forwarderId

    string

    Required

    Description:

    Forwarder identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the unarchived forwarder.


    Type:

    Forwarder object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /forwarder/:forwarderId/unarchive

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/forwarder/:forwarderId/unarchive \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Enable

    Description


    Enable a forwarder - this allows the forwarder to send logs.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    forwarderId

    string

    Required

    Description:

    Forwarder identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the enabled forwarder.


    Type:

    Forwarder object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /forwarder/:forwarderId/enable

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/forwarder/:forwarderId/enable \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Disable

    Description


    Disable a forwarder - disabled forwarders cannot send forwarder.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    forwarderId

    string

    Required

    Description:

    Forwarder identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Returns the disabled forwarder.


    Type:

    Forwarder object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /forwarder/:forwarderId/disable

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/forwarder/:forwarderId/disable \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Generate token

    Description


    Generate or regenerate a token for the forwarder. This token is used to send logs to LogHarvestor. Previous tokens no longer be valid.

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    forwarderId

    string

    Required

    Description:

    Forwarder identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    Responses


    Description:

    Forwarder with new token.


    Type:

    Forwarder object


    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /forwarder/:forwarderId/token/generate

    Request

    1
    2
    3
    4
    curl https://logharvestor.com/api/v1/forwarder/:forwarderId/token/generate \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        

    Response

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    {
        _id: "0f9c0b0b4f0c6b0017f0e3b1",
        name: "Web server 1",
        notes: "Forwarder assigned to the web server",
        host: "10.10.10.100",
        token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
        enabled: true,
        org: "0f9c0b0b4f0c6b0017f0e3b1",
        project: "0f9c0b0b4f0c6b0017f0e3b1",
        createdBy: "0f9c0b0b4f0c6b0017f0e3b1",
        tot_logs: 10000
    }

    Validate token

    Description


    Validate a forwarder token. A valid token must meet the following criteria: - The token must be signed and originated by Log Harvestor. - The token must not be expired. - The token must not be revoked. - The token must not be blacklisted. - The token must not be malformed. - The token must not be tampered with. - The forwarder must not be disabled, archived or deleted. - The forwarder settings must not be invalid. (ie. host, port, protocol, etc.)

    Parameters


    headers

    Authorization

    string

    Required

    Description:

    Bearer token - JWT

    Example:

    "Bearer <token>"

    params

    forwarderId

    string

    Required

    Description:

    Forwarder identifier

    Example:

    "0f9c0b0b4f0c6b0017f0e3b1"

    body

    token

    string

    Required

    Description:

    Forwarder token

    Example:

    "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"

    Responses


    Description:

    True if the token is valid, false otherwise.


    Type:

    boolean object


    Example:

    1
    true

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Invalid Role",
        message: "You do not have the required role to access this resource",
        status: 401
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Entity not found",
        message: "Entity not found",
        status: 404
    }

    Type:

    Error object


    Example:

    1
    2
    3
    4
    5
    {
        name: "Internal Server Error",
        message: "Internal Server Error",
        status: 500
    }

    post

    /forwarder/:forwarderId/token/validate

    Request

    1
    2
    3
    4
    5
    curl https://logharvestor.com/api/v1/forwarder/:forwarderId/token/validate \
        -X POST \
        -H 'Authorization: Bearer <token>' \
        -H 'Content-Type: application/json' \
    	--data-raw '{"token":"\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\""}'

    Response

    1
    true

    Log_Harvestor_Icon

    Join our newsletter

    support@logharvestor.com

    Copyright © Log Harvestor 2023TermsPrivacy