Skip to content
Discussion options

You must be logged in to vote

The nested path works, but .data = del(.message) stores the raw request body as a string. It does not parse the JSON inside it.

Here is your remap program with the session ID extracted into a top-level field, keeping .data in its existing string format:

payload = parse_json!(.message)
.session_id = string!(payload.data[0].attributes._session_id)
.date = del(.X_Date)
.uri = del(.X_Uri)
.ua = del(.X_User_Agent)
if get_env_var!("DEV_MODE") == "Yes" && !is_null(.fakeIp) {
  .ip = del(.fakeIp)
} else {
  .ip = del(.X_Forwarded_For)
}
if !is_null(.upload_timestamp) {
  .client_timestamp = del(.upload_timestamp)
}
.rid = del(.X_Request_ID)
.method = del(.X_Method)
.data = del(.message)
.ingest_t…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pront
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
sink:aws_kinesis_streams Anything `aws_kinesis_streams` sink related source:http_server Anything `http_server` source related transform:remap Anything `remap` transform related
2 participants