Git Product home page Git Product logo

Comments (6)

kkamkou avatar kkamkou commented on July 16, 2024 1

log.info(JSON.stringify({me: {fname: 'k', lname: 'k', bdate: new Date(2000, 01, 01)}})) does the same. If you need primitives, I think that library might suit you better.

from node-gelf-pro.

kkamkou avatar kkamkou commented on July 16, 2024

What is the expectations? Could you provide some examples?

from node-gelf-pro.

rosygupta avatar rosygupta commented on July 16, 2024

I want to dump the whole object into graylog as it is.

{me: {fname: 'k', lname: 'k', bdate: new Date(2000, 01, 01)}}
This should be one field with key : me and value: {fname: 'k', lname: 'k', bdate: new Date(2000, 01, 01)}
I assume that this capability to convert a plain object was added to the library to enhance the search in graylog. But if I do this, the number of fields in my index increases drastically and leads to index failure. Only 1000 fields are allowed in 1 index.

from node-gelf-pro.

kkamkou avatar kkamkou commented on July 16, 2024

I want to dump the whole object into graylog as it is.

You can't do that (elasticsearch is typed(Double/Long/etc.) and node.js is not). Though, you may try to use JSON.stringify. If the object is huge, try to stringify the second level only and so on.

Also, you can always implement toString() method and it'll be used automatically to convert your object into a string.

from node-gelf-pro.

rosygupta avatar rosygupta commented on July 16, 2024

This library allows me to do it: https://www.npmjs.com/package/graylog2

Refer to the screenshot
step0001

from node-gelf-pro.

rosygupta avatar rosygupta commented on July 16, 2024

Yea I get it. Btw, toString() doesn't work.

from node-gelf-pro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.