mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
add unparsed_line field if line cannot be parsed
This commit is contained in:
@ -36,6 +36,7 @@ Schema:
|
|||||||
"responses": [
|
"responses": [
|
||||||
{
|
{
|
||||||
"type": string, # 'reply', 'timeout', 'unparsable_line', etc. See `_error_type.type_map` for all options
|
"type": string, # 'reply', 'timeout', 'unparsable_line', etc. See `_error_type.type_map` for all options
|
||||||
|
"unparsed_line": string, # only if an 'unparsable_line' type
|
||||||
"timestamp": float,
|
"timestamp": float,
|
||||||
"bytes": integer,
|
"bytes": integer,
|
||||||
"response_ip": string,
|
"response_ip": string,
|
||||||
@ -395,7 +396,8 @@ def _linux_parse(data):
|
|||||||
}
|
}
|
||||||
except Exception:
|
except Exception:
|
||||||
response = {
|
response = {
|
||||||
'type': 'unparsable_line'
|
'type': 'unparsable_line',
|
||||||
|
'unparsed_line': line
|
||||||
}
|
}
|
||||||
|
|
||||||
ping_responses.append(response)
|
ping_responses.append(response)
|
||||||
@ -558,7 +560,8 @@ def _bsd_parse(data):
|
|||||||
}
|
}
|
||||||
except Exception:
|
except Exception:
|
||||||
response = {
|
response = {
|
||||||
'type': 'unparsable_line'
|
'type': 'unparsable_line',
|
||||||
|
'unparsed_line': line
|
||||||
}
|
}
|
||||||
|
|
||||||
ping_responses.append(response)
|
ping_responses.append(response)
|
||||||
@ -578,7 +581,8 @@ def _bsd_parse(data):
|
|||||||
}
|
}
|
||||||
except Exception:
|
except Exception:
|
||||||
response = {
|
response = {
|
||||||
'type': 'unparsable_line'
|
'type': 'unparsable_line',
|
||||||
|
'unparsed_line': line
|
||||||
}
|
}
|
||||||
|
|
||||||
ping_responses.append(response)
|
ping_responses.append(response)
|
||||||
|
Reference in New Issue
Block a user