public abstract class FormattedTimestampJsonProvider<Event extends DeferredProcessingAware,FieldNames extends LogstashCommonFieldNames> extends AbstractFieldJsonProvider<Event> implements FieldNamesAware<FieldNames>
FastDateFormat
patternModifier 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, setFieldName
isStarted, prepareForDeferredProcessing, start, stop
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
public 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
JsonProvider
writeTo
in interface JsonProvider<Event extends DeferredProcessingAware>
IOException
protected abstract long getTimestampAsMillis(Event event)
public String getPattern()
public void setPattern(String pattern)
public String getTimeZone()
public void setTimeZone(String timeZoneId)
Copyright © 2020. All rights reserved.