{"id":15497389,"url":"https://github.com/heapwolf/logmap","last_synced_at":"2025-12-22T23:02:39.862Z","repository":{"id":8652305,"uuid":"10304397","full_name":"heapwolf/logmap","owner":"heapwolf","description":"Filter json streams/logging output using JSONSelect and format the output","archived":false,"fork":false,"pushed_at":"2015-09-27T13:22:53.000Z","size":156,"stargazers_count":59,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T18:19:14.668Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heapwolf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-26T22:23:52.000Z","updated_at":"2022-09-27T11:05:52.000Z","dependencies_parsed_at":"2022-07-08T00:40:36.853Z","dependency_job_id":null,"html_url":"https://github.com/heapwolf/logmap","commit_stats":null,"previous_names":["hij1nx/logmap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Flogmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Flogmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Flogmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Flogmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heapwolf","download_url":"https://codeload.github.com/heapwolf/logmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250330580,"owners_count":21412999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T08:33:19.139Z","updated_at":"2025-12-22T23:02:34.535Z","avatar_url":"https://github.com/heapwolf.png","language":"JavaScript","readme":"# SYNOPSIS\nFilter \u0026 format new-line-deleimted json streams using simple object-path selectors.\n\n# MOTIVATION\nThis is not a json transform tool. It's just a simple filter \u0026 format tool.\n\n# INSTALL\n```bash\nnpm install logmap -g\n```\n\n# USAGE\nGiven some program is outputting newline-delimted-json...\n```json\n{ \"date\": \"2015-06-25T01:14:21.196+0600\", \"level\": \"info\", \"value\": { \"msg\": \"Lorem ipsum dolor sit amet.\", \"sources\": [\"C++\", \"JS\"] } }\n{ \"date\": \"2015-04-25T01:32:21.196+0600\", \"level\": \"info\", \"value\": { \"msg\": \"Mollit anim id est laborum.\", \"srouces\": [\"C++\", \"JS\"] } }\n```\n\nPipe it to the following the reduce the output using simple object-path selectors...\n\n```bash\ncat ./sample.json | logmap date level value.msg\n[\"2015-06-25T01:14:21.196+0600\", \"info\", \"Lorem ipsum dolor sit amet.\"]\n[\"2015-04-25T01:32:21.196+0600\", \"info\", \"Mollit anim id est laborum.\"]\n```\n\n## ARRAYS \u0026 ACCESSING VALUES\nYou can also access items in an array like this `foo.bar.1.thing`. In fact, you can use any \nof the object selectors found [`here`](https://github.com/mariocasciaro/object-path#usage).\n\n## FORMATTING OUTPUT\nsprintf-ish things like `%s`, `%80s`, `%d` and `%j`.\n```bash\ncat ./sample.json | logmap date level value.msg -f \"[%moment(DD HH:mm)]: (%s) %s\"\n[14 21:32]: (info) Lorem ipsum dolor sit amet.\n[24 21:32]: (info) Mollit anim id est laborum.\n```\n\n### COLOR\n`%chalk(inverse.red)`, invokes [`chalk`](https://github.com/chalk/chalk). there are a few\nshortcuts like `%red`, `%blue`, etc. use `%chalk(...)` for more complicated things.\n\n### DATES\nAnything inside the `%moment(...)` like `%moment(MM YY d:mm)` just invokes [`moment`](https://github.com/moment/moment)\n\n### EXPRESSIONS\nSometimes you dont want to putput a record based on some simple boolean logic, for that\nyou can use quoted expressions with `\u003e`, `\u003c`, `\u003e=`, `\u003c=`, `==`, `!=`.\n\n```\ncat ./sample.json | log.name log.message \"log.priority \u003e 2\"\ncat ./books.json | log.name \"title == \\\"Programming\\\"\"\n```\n\n# OPTIONS\nIf you write a long query, you can save it so you don't have to write it again.\n\n### SAVE\n```bash\ncat ./sample.json | logmap user.name.last, user.name.first, user.age -f \"%s, %s (%s)\" -s myQuery\n```\n\n### LOAD\n```bash\ncat ./sample.json | logmap -l myQuery\n```\n\n### DELETE\n```bash\nlogmap -d myQuery\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Flogmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheapwolf%2Flogmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Flogmap/lists"}