org.apache.flume.interceptor

## Class TimestampInterceptor

- java.lang.Object
- - org.apache.flume.interceptor.TimestampInterceptor

- All Implemented Interfaces:
    Interceptor

      public class TimestampInterceptor
      extends Object
      implements Interceptor

  Simple Interceptor class that sets the current system timestamp on all events that are intercepted. By convention, this timestamp header is named "timestamp" and its format is a "stringified" long timestamp in milliseconds since the UNIX epoch.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TimestampInterceptor.Builder` Builder which builds new instances of the TimestampInterceptor.
    `static class` | `TimestampInterceptor.Constants`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Perform any closing / shutdown needed by the Interceptor.
    `void` | `initialize()` Any initialization / startup needed by the Interceptor.
    `Event` | `intercept(Event event)` Modifies events in-place.
    `List<Event>` | `intercept(List<Event> events)` Delegates to `intercept(Event)` in a loop.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### initialize

          public void initialize()

      Description copied from interface: `Interceptor`
      Any initialization / startup needed by the Interceptor.
      Specified by:
        `initialize` in interface `Interceptor`

    - #### intercept

          public Event intercept(Event event)

      Modifies events in-place.
      Specified by:
        `intercept` in interface `Interceptor`
      Parameters:
        `event` - Event to be intercepted
      Returns:
        Original or modified event, or `null` if the Event is to be dropped (i.e. filtered out).

    - #### intercept

          public List<Event> intercept(List<Event> events)

      Delegates to `intercept(Event)` in a loop.
      Specified by:
        `intercept` in interface `Interceptor`
      Parameters:
        `events` -
      Returns:

    - #### close

          public void close()

      Description copied from interface: `Interceptor`
      Perform any closing / shutdown needed by the Interceptor.
      Specified by:
        `close` in interface `Interceptor`

Copyright © 2009-2016 Apache Software Foundation. All Rights Reserved.