Skip to content

Deserialization Failure #4876

@clearscreen

Description

@clearscreen

NEST/Elasticsearch.Net version: 7.8.1

Elasticsearch version: 7.8.0

Description of the problem including expected versus actual behavior: We're ingesting suricata eve logs with timestamps in the default suricata format: 2020-07-23T14:43:46.129022-0400. We are getting an exception (see below) when we try to deserialize in NEST.

Steps to reproduce:

  1. Ingest a suricata log into elasticsearch
  2. Attempt to deserialize the log. It will throw an exception complaining about the datetime format of the timestamp field.

Exception:

System.InvalidOperationException: invalid datetime format. value:2020-07-23T14:43:46.129022-0400
   at Elasticsearch.Net.Utf8Json.Formatters.ISO8601DateTimeFormatter.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)

Test Document:

{
	"_index": "suricata-2020.07.23",
	"_type": "_doc",
	"_id": "DSpHfXMBvOItDiFCmKJQ",
	"_version": 1,
	"_seq_no": 3756084,
	"_primary_term": 1,
	"found": true,
	"_source": {
		"flow": {
			"bytes_toserver": 60,
			"bytes_toclient": 0,
			"pkts_toclient": 0,
			"start": "2020-07-23T16:04:33.400720-0400",
			"pkts_toserver": 1
		},
		"@timestamp": "2020-07-23T20:04:34.363Z",
		"input": {
			"type": "log"
		},
		"tags": [
			"suricata",
			"beats_input_codec_plain_applied"
		],
		"stream": 0,
		"@version": "1",
		"timestamp": "2020-07-23T16:04:33.400720-0400",
		"payload": "",
		"ecs": {
			"version": "1.5.0"
		},
		"event_type": "alert"
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions