Configure a Collector or Fetcher in a Log Collection Policy

The LogCollectionPolicies API allows you to create the rules that a Fabric-enabled LogPoint uses to collect logs.

You can configure different collectors and fetchers in a log collection policy. Once created, you can apply the same policy to multiple devices to speed up the configuration process.

Follow the steps mentioned below to configure a Collector or Fetcher in a Log Collection Policy:

Create a Log Collection Policy

  1. Execute the LogCollectionPolicies - Create API with the required parameters.

Add Collectors/Fetchers to the Log Collection Policy

  1. Execute the ProcessingPolicies - List API to obtain the value of the id parameter. Use this value in the processpolicy parameter of the Collector/Fetcher - Create API. Refer to the Create a Processing Policy section if you have not already created the processing policy.

  2. Execute the LogCollectionPolicies - List API to obtain the value of the policy_id parameter. Use this value in the policy_id parameter of the Collector/Fetcher - Create API.

  3. Execute the Collector/Fetcher - Create API with the required parameters. For instance, to create an FTP collector, execute the FTPCollectorPlugin - Create API.

circle-info
  • You can add one or more collector/fetcher in a log collection policy.

  • While adding a Syslog collector in a log collection policy, the value of the proxy_condition parameter must be None.

Sample API Requests and Responses for configuring a Collector/Fetcher in a Log Collection Policy

Create a Log Collection Policy

  1. Execute the LogCollectionPolicies - Create API.

    POST
    https://api-server-host-name/configapi/{pool_UUID}/{logpoint_identifier}/LogCollectionPolicies
    
    Request:
    
    {
        "data": {
        "name": "lcp1",
        "description": "CreatedfromAPI"
        }
    }
    
    Response:
    
    {
        "status": "Success",
        "message": "monitorapi/17b77d08934744fdbd7c1d0194ba22aa/41b5b7fffa6c4e3cb6bc6d799a5ee6e5/orders/5f356524-9001-4dd6-899a-b128e2acf1f0"
    }   
    
    Monitoring API:
    
    .. code::
    
    GET
    https://api-server-host-name/monitorapi/17b77d08934744fdbd7c1d0194ba22aa/41b5b7fffa6c4e3cb6bc6d799a5ee6e5/orders/5f356524-9001-4dd6-899a-b128e2acf1f0
    
    Response:
    
    {
    "request": {},
    "logpoint_identifier": "41b5b7fffa6c4e3cb6bc6d799a5ee6e5",
    "pool_uuid": "17b77d08934744fdbd7c1d0194ba22aa",
    "response": {
        "success": true,
        "id": "5e035dfed8df1d8bd876c7f1",
        "message": "Logcollection policy added"
        }
    }

This step successfully creates a log collection policy.

Add Collectors/Fetchers to the Log Collection Policy

  1. Execute the ProcessingPolicies - List API to obtain the value of the id parameter. Use this value in the processpolicy parameter of the Collector/Fetcher - Create API.

  2. Execute the LogCollectionPolicies - List API to obtain the value of the policy_id parameter. Use this value in the policy_id parameter of the Collector/Fetcher - Create API.

  3. Execute the Collector/Fetcher - Create API with the required parameters. For instance, to create an FTP collector, execute the FTPCollectorPlugin - Create API.

This step successfully adds an FTP collector in a log collection policy.

Last updated

Was this helpful?