Class SplunkEvent.Builder

  • Enclosing class:
    SplunkEvent

    public abstract static class SplunkEvent.Builder
    extends java.lang.Object
    A builder class for creating a SplunkEvent.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • withTime

        public SplunkEvent.Builder withTime​(java.lang.Long time)
        Assigns time value to the event metadata.
        Parameters:
        time - time value to assign
      • withHost

        public SplunkEvent.Builder withHost​(java.lang.String host)
        Assigns host value to the event metadata.
        Parameters:
        host - host value to assign
      • withSource

        public SplunkEvent.Builder withSource​(java.lang.String source)
        Assigns source value to the event metadata.
        Parameters:
        source - source value to assign
      • withSourceType

        public SplunkEvent.Builder withSourceType​(java.lang.String sourceType)
        Assigns sourceType value to the event metadata.
        Parameters:
        sourceType - sourceType value to assign
      • withIndex

        public SplunkEvent.Builder withIndex​(java.lang.String index)
        Assigns index value to the event metadata.
        Parameters:
        index - index value to assign
      • withFields

        public SplunkEvent.Builder withFields​(com.google.gson.JsonObject fields)
        Assigns fields value to the event metadata.
        Parameters:
        fields - fields value to assign
      • withEvent

        public SplunkEvent.Builder withEvent​(java.lang.String event)
        Assigns the event payload to be sent to the HEC endpoint.
        Parameters:
        event - payload to be sent to HEC