Skip to content

Commit

Permalink
Merge pull request #667 from openedx/cag/fix-vector
Browse files Browse the repository at this point in the history
fix: send event as str from vector to the 'event' field
  • Loading branch information
Cristhian Garcia authored Mar 18, 2024
2 parents 9b8f94e + 7a9d7e8 commit 10d4df2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if err_timestamp != null {
}
}
event_id = parsed_json.id
. = {"event_id": event_id, "emission_time": format_timestamp!(time, format: "%+"), "event_str": encode_json(parsed_json)}
. = {"event_id": event_id, "emission_time": format_timestamp!(time, format: "%+"), "event": encode_json(parsed_json)}
'''
drop_on_error = true
drop_on_abort = true
Expand All @@ -77,7 +77,7 @@ type = "remap"
inputs = ["xapi"]
# Time formats: https://docs.rs/chrono/0.4.19/chrono/format/strftime/index.html#specifiers
source = '''
.message = parse_json!(.event_str)
.message = parse_json!(.event)
'''

### Sinks
Expand All @@ -93,7 +93,7 @@ encoding.only_fields = ["time", "message.context.course_id", "message.context.us
type = "console"
inputs = ["xapi_debug"]
encoding.codec = "json"
encoding.only_fields = ["event_id", "emission_time", "message.verb.id"]
encoding.only_fields = ["event_id", "emission_time", "event"]

# # Send logs to clickhouse
[sinks.clickhouse]
Expand Down

0 comments on commit 10d4df2

Please sign in to comment.