Class UuidJsonProvider<Event extends DeferredProcessingAware>

All Implemented Interfaces:
ContextAware, JsonProvider<Event>
Direct Known Subclasses:
UuidProvider

public class UuidJsonProvider<Event extends DeferredProcessingAware> extends AbstractFieldJsonProvider<Event>
Outputs random UUID as field value. Handy when you want to provide unique identifier for log lines.
  • Field Details

    • FIELD_UUID

      public static final String FIELD_UUID
      See Also:
    • STRATEGY_RANDOM

      public static final String STRATEGY_RANDOM
      Type 4 UUID.
      See Also:
    • STRATEGY_TIME

      public static final String STRATEGY_TIME
      Type 1 time based UUID. When the time strategy is used, then ethernet can be set to either 'interface' (to automatically pick a MAC address from a network interface) or a MAC address string.
      See Also:
  • Constructor Details

    • UuidJsonProvider

      public UuidJsonProvider()
  • Method Details

    • writeTo

      public void writeTo(JsonGenerator generator, Event event) throws IOException
      Description copied from interface: JsonProvider
      Writes information about the event, to the given generator.

      When called, the generator is assumed to be within a JSON object context (i.e. this provider should write fields and their values to the generator). Upon return, the generator should be within the same JSON object context.

      Parameters:
      generator - the JsonGenerator to produce JSON content
      event - the event to convert into JSON
      Throws:
      IOException - if an I/O error occurs
    • getStrategy

      public String getStrategy()
    • setStrategy

      public void setStrategy(String strategy)
    • getEthernet

      public String getEthernet()
    • setEthernet

      public void setEthernet(String ethernet)