Skip to content

Commit

Permalink
Started extracting true_tstamp from querystring (closes #1968)
Browse files Browse the repository at this point in the history
  • Loading branch information
fblundun committed Sep 25, 2015
1 parent 9c85bcb commit e9380c5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ object EnrichmentManager {
("vid" , (CU.stringToJInteger, "domain_sessionidx")),
("sid" , (CU.validateUuid, "domain_sessionid")),
("dtm" , (EE.extractTimestamp, "dvce_tstamp")),
("ttm" , (EE.extractTimestamp, "true_tstamp")),
("stm" , (EE.extractTimestamp, "dvce_sent_tstamp")),
("tna" , (ME.toTsvSafe, "name_tracker")),
("tv" , (ME.toTsvSafe, "v_tracker")),
Expand Down Expand Up @@ -427,16 +428,22 @@ object EnrichmentManager {
unitSuccess
})

val derivedTstamp = EE.getDerivedTimestamp(
Option(event.dvce_sent_tstamp),
Option(event.dvce_tstamp),
Option(event.collector_tstamp)
) match {
case Success(dt) => {
dt.foreach(event.derived_tstamp = _)
val derivedTstamp = event.true_tstamp match {
case null =>
EE.getDerivedTimestamp(
Option(event.dvce_sent_tstamp),
Option(event.dvce_tstamp),
Option(event.collector_tstamp)
) match {
case Success(dt) => {
dt.foreach(event.derived_tstamp = _)
unitSuccess
}
case f => f
}
case trueTstamp =>
event.derived_tstamp = trueTstamp
unitSuccess
}
case f => f
}

// Execute the JavaScript scripting enrichment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,7 @@ class EnrichedEvent {

// Event fingerprint
@BeanProperty var event_fingerprint: String = _

// True timestamp
@BeanProperty var true_tstamp: String = _
}

0 comments on commit e9380c5

Please sign in to comment.