{"id":20643873,"url":"https://github.com/adjust/cblogger","last_synced_at":"2025-05-10T08:31:09.610Z","repository":{"id":57604847,"uuid":"50014007","full_name":"adjust/cblogger","owner":"adjust","description":"simple script to catch callbacks from adjust and log them into storage, like AWS S3 buckets","archived":true,"fork":false,"pushed_at":"2016-04-29T05:50:22.000Z","size":7,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-09T14:39:57.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adjust.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-01-20T07:52:39.000Z","updated_at":"2024-09-10T12:51:34.000Z","dependencies_parsed_at":"2022-09-26T20:01:13.177Z","dependency_job_id":null,"html_url":"https://github.com/adjust/cblogger","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/adjust%2Fcblogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fcblogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fcblogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fcblogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adjust","download_url":"https://codeload.github.com/adjust/cblogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253389740,"owners_count":21900805,"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-11-16T16:14:10.499Z","updated_at":"2025-05-10T08:31:09.138Z","avatar_url":"https://github.com/adjust.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cblogger\n\n## Installation\n\n### 0. Fork the repo\n\nYou *will* need to modify the source `cblogger.go`. This repo is only a scaffold.\nTo be able to versionize and push your changes you should fork the repo and put it under your prefered version control.\n\n### 1. Get the source to your server\n\nThe easiest would be to just clone the repo to your server.\n\n```git clone \u003crepo url\u003e```\n\nOf course you can also integrate it with your prefered deployment tools.\n\n### 2. The init script\n\nThe repo contains an example init script that works on AWS AMI images.\nIf you need to change the options with which the logger starts, you can edit it here.\n\nThe supported parameters are:\n\n`--logdir`\nWhere to put the csv files.\nThe default is `./`.\n\n`--logfile`\nThe name of the current log file.\nThe default is `csv`.\n\n`--time`\nThe suffix each file gets. The option accepts the golang time [strings](https://golang.org/pkg/time/#Time.Format).\nThe default is `2006-01-02_15`.\n\n`--location`\nThe time location.\nThe default is `UTC`.\n\n`--s3`\nThe s3 bucket name. By default this is unset, which means no rotation to s3.\nIf you don't setup s3 rotation old files are not deleted.\nIf you use s3 rotation only the last 12 files are kept locally.\nIf rotation to s3 fails, the files gets renamed to `failed_\u003cfilename\u003e` and gets excluded from deletion.\n\n`--interval`\nHow often to move the files out. The default is 3600 seconds.\nIf you change the rotation interval you will have to change the `--time` parameter as well to avoid overwriting your files.\n\n`--port`\nThe port on which the cblogger runs.\nThe default is 3000.\n\n### 3. Installation\n\nIf you use an AWS AMI image the installation should be as simple as\n\n```sudo bash bootstrap.sh```\n\nThis will do the following steps:\n\n- update your system\n- install the golang package\n- install and configure nginx, add nginx to default runlevel and start nginx\n- install the deamonize software\n- build the binary, configure the init script, add to default runlevel and the start the  software\n\nIf you want to use the hourly push to s3 you also need to configure the aws cli tool to use your credentials.\n\n```bash\nsudo su -\naws configure\n\u003cfollow the dialog\u003e\n```\n\nPlease be aware that this setup will run this software as root. If you are not comfortable with it, you need to edit the init script and permissions.\n\nAlso if you want to use another webserver than nginx, you will need to perform the steps described in ```bootstrap.sh``` and replace the nginx steps with appropriate configuration steps for your prefered webserver.\n\n\n## Customizing\n\nIf you want to add other placeholders to your csv files, you can do that by editing the source code. There is an array called `paramList` which holds all params you are interested in.\n\nA little example: We set a callback in our adjust dashboard that reads:\n\n```\nhttp://your-domain/?app_name=my_app\u0026event_name={event}\n```\n\nadjust would replace {event} with an appropriate value, resulting in a callback that looks something like:\n\n```\nhttp://your-domain/?app_name=my_app\u0026event_name=f0ob4r\n```\n\nNow say you want your CSV to look like this:\n\n```\n\"event_name\",\"app_name\"\n```\n\nSo your paramList needs to look like that:\n\n```go\nparamList = []string{\n    \"app_name\", \"event_name\",\n}\n// trailing comma is important!\n```\n\nAfter you edited the source code, you can rebuild the binary and restart the software with\n\n```\nsudo bash build.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Fcblogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadjust%2Fcblogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Fcblogger/lists"}