public abstract class FormattedTimestampJsonProvider<Event extends DeferredProcessingAware,FieldNames extends LogstashCommonFieldNames> extends AbstractFieldJsonProvider<Event> implements FieldNamesAware<FieldNames>
FastDateFormat pattern| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_TIMESTAMP |
static String |
UNIX_TIMESTAMP_AS_NUMBER
Setting the
pattern as this value will make it so that the timestamp
is written as a number value of the milliseconds since unix epoch. |
static String |
UNIX_TIMESTAMP_AS_STRING
Setting the
pattern as this value will make it so that the timestamp
is written as a string value representing the number of milliseconds since unix epoch |
context| Constructor and Description |
|---|
FormattedTimestampJsonProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getFormattedTimestamp(Event event) |
String |
getPattern() |
protected abstract long |
getTimestampAsMillis(Event event) |
String |
getTimeZone() |
void |
setFieldNames(FieldNames fieldNames) |
void |
setPattern(String pattern) |
void |
setTimeZone(String timeZoneId) |
void |
writeTo(JsonGenerator generator,
Event event)
Writes information about the event,
to the given generator.
|
getFieldName, setFieldNameisStarted, prepareForDeferredProcessing, start, stopaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContextpublic static final String FIELD_TIMESTAMP
public static final String UNIX_TIMESTAMP_AS_NUMBER
pattern as this value will make it so that the timestamp
is written as a number value of the milliseconds since unix epoch.public static final String UNIX_TIMESTAMP_AS_STRING
pattern as this value will make it so that the timestamp
is written as a string value representing the number of milliseconds since unix epochpublic void setFieldNames(FieldNames fieldNames)
setFieldNames in interface FieldNamesAware<FieldNames extends LogstashCommonFieldNames>public void writeTo(JsonGenerator generator, Event event) throws IOException
JsonProviderwriteTo in interface JsonProvider<Event extends DeferredProcessingAware>IOExceptionprotected abstract long getTimestampAsMillis(Event event)
public String getPattern()
public void setPattern(String pattern)
public String getTimeZone()
public void setTimeZone(String timeZoneId)
Copyright © 2019. All rights reserved.