Class LogsIngestionClient

java.lang.Object
com.azure.monitor.ingestion.LogsIngestionClient

public final class LogsIngestionClient extends Object
The synchronous client for uploading logs to Azure Monitor.
  • Method Details

    • upload

      public UploadLogsResult upload(String dataCollectionRuleId, String streamName, List<Object> logs)
      Uploads logs to Azure Monitor with specified data collection rule id and stream name. The input logs may be too large to be sent as a single request to the Azure Monitor service. In such cases, this method will split the input logs into multiple smaller requests before sending to the service.
      Parameters:
      dataCollectionRuleId - the data collection rule id that is configured to collect and transform the logs.
      streamName - the stream name configured in data collection rule that matches defines the structure of the logs sent in this request.
      logs - the collection of logs to be uploaded.
      Returns:
      the result of the logs upload request.
      Throws:
      NullPointerException - if any of dataCollectionRuleId, streamName or logs are null.
      IllegalArgumentException - if logs is empty.
    • upload

      public UploadLogsResult upload(String dataCollectionRuleId, String streamName, List<Object> logs, UploadLogsOptions options, com.azure.core.util.Context context)
      Uploads logs to Azure Monitor with specified data collection rule id and stream name. The input logs may be too large to be sent as a single request to the Azure Monitor service. In such cases, this method will split the input logs into multiple smaller requests before sending to the service.
      Parameters:
      dataCollectionRuleId - the data collection rule id that is configured to collect and transform the logs.
      streamName - the stream name configured in data collection rule that matches defines the structure of the logs sent in this request.
      logs - the collection of logs to be uploaded.
      options - the options to configure the upload request.
      context - additional context that is passed through the Http pipeline during the service call. If no additional context is required, pass Context.NONE instead.
      Returns:
      the result of the logs upload request.
      Throws:
      NullPointerException - if any of dataCollectionRuleId, streamName or logs are null.
      IllegalArgumentException - if logs is empty.