Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions etc/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,9 @@
"status": {
"type": "integer"
},
"status_str": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have no occurrences of _str, but do have one as _string, so maybe we should stick with that.

Also, please add a description. I wonder if that description should also include the rule keyword for matching? Or if not applicable, even state that somehow?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess a http.stat_code.raw? or http.stat.raw

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I will go with status_string instead of opening a new json object

"type": "string"
},
"true_client_ip": {
"type": "string"
},
Expand Down
8 changes: 2 additions & 6 deletions src/output-json-http.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,8 @@ static void EveHttpLogJSONExtended(JsonBuilder *js, htp_tx_t *tx)
if (resp > 0) {
jb_set_uint(js, "status", (uint32_t)resp);
} else if (tx->response_status != NULL) {
const size_t status_size = bstr_len(tx->response_status) * 2 + 1;
char status_string[status_size];
BytesToStringBuffer(bstr_ptr(tx->response_status), bstr_len(tx->response_status),
status_string, status_size);
unsigned int val = strtoul(status_string, NULL, 10);
jb_set_uint(js, "status", val);
jb_set_string_from_bytes(js, "status_str", bstr_ptr(tx->response_status),
(uint32_t)bstr_len(tx->response_status));
}

htp_header_t *h_location = htp_table_get_c(tx->response_headers, "location");
Expand Down