{"id":17166662,"url":"https://github.com/willf/translog","last_synced_at":"2025-03-24T18:15:38.425Z","repository":{"id":57525637,"uuid":"54569816","full_name":"willf/translog","owner":"willf","description":"A log file tailer that sends structured data to various backends","archived":false,"fork":false,"pushed_at":"2016-05-05T19:04:44.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T12:52:28.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-23T15:10:56.000Z","updated_at":"2018-08-29T20:55:54.000Z","dependencies_parsed_at":"2022-08-28T20:22:18.494Z","dependency_job_id":null,"html_url":"https://github.com/willf/translog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willf%2Ftranslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willf%2Ftranslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willf%2Ftranslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willf%2Ftranslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willf","download_url":"https://codeload.github.com/willf/translog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245325221,"owners_count":20596818,"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-14T23:06:18.947Z","updated_at":"2025-03-24T18:15:38.396Z","avatar_url":"https://github.com/willf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# translog\n\n[![Join the chat at https://gitter.im/willf/translog](https://badges.gitter.im/willf/translog.svg)](https://gitter.im/willf/translog?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\nA log file tailer that sends structured data to various backends\n\n## Basic introduction\n\nThe typical use case is that a _log file_ is being appended to by some process,\nlikely being [rotated](https://en.wikipedia.org/wiki/Log_rotation) every so\noften. The log lines themselves are can be parsed using some regular expression\nwith variables, and the data is recognizable as dates, strings, integers, booleans,\nfloats, or (URIs)[https://en.wikipedia.org/wiki/Uniform_Resource_Identifier].\nFurthermore, if a URI is recognized, the query parameters of the URI are also\ninterpretable as dates, strings, integers, booleans, or floats.\n\nFor example, the following log line:\n```\n2016-04-01T11:00:00Z 8.8.8.8.8 http://entish.org?q=Bob\u0026age=47\n```\nCould be recognized with the following regular expression:\n```\n(?P\u003ccreated\u003e\\S+)\\s+(?P\u003cip\u003e\\S+)\\s+(?P\u003curi\u003e*.)\n```\nAnd would result in the following structured information:\n```\ncreated: 2016-04-01T11:00:00Z\nip: \"8.8.8.8\"\nuri: \"http://entish.org?q=Bob\u0026age=47\"\nq: \"Bob\"\nage: 47\n```\n\nThis structured format is then used by one of the configured sub-programs for\nprocessing (sending to ElasticSearch, printing to stdout, etc).\n\n## Configuration\n\nTranslog uses a a configuration file for many of its configuration files. It\ncan be in TOML, YAML, or JSON format (anything that [Viper](https://github.com/spf13/viper))\nsupports.\n\nThe following shows the default configuration values, including those which\nare required, and have no default value:\n\n```TOML\n[pid]\nfile = \"/var/translog.pid\"   # where to store PID file\noverwrite = true             # should the PID file be overwritten if it already exists\n\n[logging]\nfile = \"/var/translog.log\"   # location of Log file (this is _Translog_'s log file)\nlevel = \"INFO\"               # logging level (DEBUG/INFO/WARN/ERROR/FATAL)\n\n[parse]\npattern = '(?P\u003cline\u003e.*)'        # structured patter.\ninput_file = \"/tmp/example.log\" # required; no default\ntime_patterns = []              # additional time patterns in [Golang time format](https://golang.org/pkg/time/#pkg-constants)\nkeys_to_ignore = []             # keys to *not* use in output\n\n\n[cpus]\ncpus = 4                     # defaults to the number of CPUs of machine\n\n[tail]\nfrom_beginning = false       # start processing log at end\nreopen = true                # reopen files (like `tail -F`)\n\n# ElasticSearch processing\n[es]\nmocking = false              # set to true to send to STDOUT\nhost = \"localhost\"           # ElasticSearch host\nport = 9200                  # ElasticSearch port\nscheme = \"http\"              # ElasticSearch scheme (http or https)\nmax = 500                    # how many documents to bulk-upload at a time\nflush_every = 10000          # how many documents to process before bulk uploading\nindex = \"analytics\"          # name of index\ndocument_type = \"event\"      # name of document type\nuse_date_suffix = false      # add YYYY.MM.DD to end of document type\n\n# File processing\n[file]\nout = \"output.jsonl\"          # file name to write JSON objects to\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillf%2Ftranslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillf%2Ftranslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillf%2Ftranslog/lists"}