How to log nested objects with elastic (ELK) stack
This is because when you've logged param1
as a string, ES created a field of type string.
Thereafter, you tried to log param1
as an object and that was conflicting with the the string type.
However, you can definitely log a nested object but you have to give it another name that a field that already exists, say param3
, that should work:
// sending an objectvar obj = { message: 'Some log message', param3: { a : 'b', c : 'd' }, param2: 'val2'};