Skip to content

Commit 9006a23

Browse files
authored
Merge pull request #330 from splunk/jackson-databind-changes
Timestamp format jackson-databind 2.12.6.1 changes
2 parents 374ef35 + ddbd37d commit 9006a23

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
<dependency>
2626
<groupId>com.fasterxml.jackson.core</groupId>
2727
<artifactId>jackson-core</artifactId>
28-
<version>2.10.5</version>
28+
<version>2.12.6</version>
2929
<scope>compile</scope>
3030
</dependency>
3131
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
3232
<dependency>
3333
<groupId>com.fasterxml.jackson.core</groupId>
3434
<artifactId>jackson-databind</artifactId>
35-
<version>2.10.5.1</version>
35+
<version>2.12.6.1</version>
3636
<scope>compile</scope>
3737
</dependency>
3838
<dependency>

src/main/java/com/splunk/hecclient/Event.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
import org.slf4j.*;
2424

2525
import java.io.*;
26+
import java.text.SimpleDateFormat;
2627
import java.util.Map;
28+
import java.util.TimeZone;
2729

2830
/**
2931
* Event is an abstract class that represents a bare bones implementation of a Splunk Event. Every event that arrives
@@ -48,7 +50,9 @@ public abstract class Event {
4850
static {
4951
jsonMapper = new ObjectMapper();
5052
jsonMapper.registerModule(new com.splunk.kafka.connect.JacksonStructModule());
51-
jsonMapper.setDateFormat(StdDateFormat.instance);
53+
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
54+
df.setTimeZone(TimeZone.getTimeZone("UTC"));
55+
jsonMapper.setDateFormat(df);
5256
}
5357

5458
protected static final Logger log = LoggerFactory.getLogger(Event.class);

0 commit comments

Comments
 (0)