Class HttpEventCollectorSender

    • Field Detail

      • DefaultBatchInterval

        public static final int DefaultBatchInterval
        Recommended default values for events batching.
        See Also:
        Constant Field Values
    • Constructor Detail

      • HttpEventCollectorSender

        public HttpEventCollectorSender​(String Url,
                                        String token,
                                        String channel,
                                        String type,
                                        long delay,
                                        long maxEventsBatchCount,
                                        long maxEventsBatchSize,
                                        String sendModeStr,
                                        Map<String,​String> metadata,
                                        HttpEventCollectorSender.TimeoutSettings timeoutSettings)
        Initialize HttpEventCollectorSender
        Parameters:
        Url - http event collector input server
        token - application token
        delay - batching delay
        maxEventsBatchCount - max number of events in a batch
        maxEventsBatchSize - max size of batch
        metadata - events metadata
        channel - unique GUID for the client to send raw events to the server
        type - event data type
    • Method Detail

      • send

        public void send​(long timeMsSinceEpoch,
                         String severity,
                         String message,
                         String logger_name,
                         String thread_name,
                         Map<String,​String> properties,
                         String exception_message,
                         Serializable marker)
        Send a single logging event in case of batching the event isn't sent immediately
        Parameters:
        severity - event severity level (info, warning, etc.)
        message - event text
      • send

        public void send​(String message)
        Send a single logging event with message only in case of batching the event isn't sent immediately
        Parameters:
        message - event text
      • flush

        public void flush()
        Flush all pending events
      • flush

        public void flush​(boolean close)
      • run

        public void run()
        Timer heartbeat
        Specified by:
        run in interface Runnable
        Specified by:
        run in class TimerTask
      • disableCertificateValidation

        public void disableCertificateValidation()
        Disable https certificate validation of the splunk server. This functionality is for development purpose only.
      • setEventBodySerializer

        public void setEventBodySerializer​(EventBodySerializer eventBodySerializer)
      • setEventHeaderSerializer

        public void setEventHeaderSerializer​(EventHeaderSerializer eventHeaderSerializer)
      • putIfPresent

        public static void putIfPresent​(com.google.gson.JsonObject collection,
                                        String tag,
                                        Object value)