{"id":27334896,"url":"https://github.com/dmuth/splunk-fitbit","last_synced_at":"2025-10-26T07:03:06.028Z","repository":{"id":138471229,"uuid":"199094506","full_name":"dmuth/splunk-fitbit","owner":"dmuth","description":"Splunk data from your Fitbit!","archived":false,"fork":false,"pushed_at":"2020-09-03T22:22:22.000Z","size":264,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T14:51:27.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmuth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-27T00:05:41.000Z","updated_at":"2019-09-15T00:09:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d1a1847-01be-48f2-9571-02ae52a119c0","html_url":"https://github.com/dmuth/splunk-fitbit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmuth/splunk-fitbit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fsplunk-fitbit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fsplunk-fitbit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fsplunk-fitbit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fsplunk-fitbit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmuth","download_url":"https://codeload.github.com/dmuth/splunk-fitbit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fsplunk-fitbit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267141160,"owners_count":24041982,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-04-12T14:46:35.039Z","updated_at":"2025-10-26T07:03:05.955Z","avatar_url":"https://github.com/dmuth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Splunking Fitbit Data\n\nSome years ago, I bought a Fitbit Charge 2 so I could track my activity.\nAs a surprise to exactly no one, I have pretty bad sleeping habits.\nFitbit's dashboard is alright, but I wanted a little more freedom to do\ndata analytics on the data my way, and that's how this app came into being!\n\nWith Splunk Fitbit, the following metrics will be reported on:\n\n- Sleep data\n   - Nightly hours asleep, broken down by day of week\n   - \"Good\" sleep days ( \u003e 7 hours of sleep) and \"Bad\" sleep days ( \u003c 7 hours) by week.\n   - Trending good/bad sleep days over the last 30 days\n- Heartrate data\n   - Resting heartrate by day (more on how it's calculated below)\n   - Trending minimum resting heartrate over the last 30 days\n   - Trending maximum resting heartrate over the last 30 days\n \n   \nThis app uses \u003ca href=\"https://github.com/dmuth/splunk-lab\"\u003eSplunk Lab\u003c/a\u003e, an open-source \napp I built to effortlessly run Splunk in a Docker container.\n\n\n# Screenshots\n\n\u003ca href=\"img/fitbit-sleep-dashboard.png\"\u003e\u003cimg src=\"img/fitbit-sleep-dashboard.png\" width=\"300\" /\u003e\u003c/a\u003e \u003ca href=\"img/fitbit-heartrate-report.png\"\u003e\u003cimg src=\"img/fitbit-heartrate-report.png\" width=\"300\" /\u003e\u003c/a\u003e \n\n\n## Requirements\n\n- Make sure Docker is installed\n\n\n\n## Running The App\n\n- Go to https://www.fitbit.com/settings/data/export and download your fitbit data\n- Unzip the ZIP file\n- Move your exported data into a local directory called `fitbit/`:\n   - `mv path/to/fitbit/USERNAME/user-site-export fitbit`\n- `SPLUNK_START_ARGS=--accept-license bash \u003c(curl -s https://raw.githubusercontent.com/dmuth/splunk-fitbit/master/go.sh)`\n   - This will run a Python script which will read in the JSON data from Fitbit (both types of data are in different formats...) and write it out into a `logs/` directory\n   - If you want to change how many days back the script goes for either sleep or heartrate data, or change rollup values for heartrate data, add `-h` onto the end of that command to get syntax.\n   - Then, Splunk will be started. Ingested data will be written to `splunk-data/`\n- Go to \u003ca href=\"https://localhost:8000/\"\u003ehttps://localhost:8000/\u003c/a\u003e, log in with the password you set, and you'll see your Fitbit data in a dashboard!\n\n\n## Development\n\nMostly for my benefit, these are the scripts that I use to make my life easier:\n\n- `./bin/build.sh` - Build the Python and Splunk Docker containers\n- `./bin/push.sh` - Upload the Docker containers to Docker Hub\n- `./bin/devel.sh` - Build and run the Splunk Docker container with an interactive shell\n- `./bin/stop.sh` - Stop the Splunk container\n- `./bin/clean.sh` - Stop Splunk, and remove the data and logs\n\n\n## Notes/Bugs\n\n- Don't bother trying to get steps--the data in the export doesn't match what's in the dashboard at ALL.  Step counts are wrong, days are missing, etc.  If Fitbit fixes this, then I will add in support. :-)\n- I can't seem to get rangemaps working for nightly sleep hours, which is frustrating\n- Heartrate data has an insane volume--nearly as often as 1 reading every 5 seconds.  So my import script will do rollup and output the avg/min/max/mean of all values.  By default, the rollup period is 5 minutes.  This can be adjusted, but may break certain assumptions in the graphs.\n- I was able to approximate, but not perfectly match Fitbit's resting heartrate as reported on my personal dashboard on the site.  I ended up grabbing the 6 periods with the lowest minimum heartrate each day, and average those readings out to get a daily value.  Not great, not terrible.\n   - I suspect that Fitbit's readings come from having higher granularity of the data, using only readings from the deepest part of sleep, and possibly throwing in a weighted average as well.\n\n\n## Credits\n\nI'd like to thank \u003ca href=\"http://splunk.com/\"\u003eSplunk\u003c/a\u003e, for having such a kick-ass data\nanalytics platform, and the operational excellence which it embodies.\n\nAlso:\n- \u003ca href=\"http://patorjk.com/software/taag/#p=display\u0026h=0\u0026v=0\u0026f=Standard\u0026t=Splunk%20Lab\"\u003eThis text to ASCII art generator\u003c/a\u003e, for the logo I used in the script.\n\n\n## Copyright\n\nSplunk is copyright by Splunk.  Apps included within Splunk Lab are copyright their creators,\nand made available under the respective license.  \n\n\n## Contact\n\n- \u003ca href=\"mailto:doug.muth@gmail.com\"\u003eEmail me\u003c/a\u003e\n- \u003ca href=\"https://twitter.com/dmuth\"\u003eTwitter\u003c/a\u003e\n- \u003ca href=\"https://facebook.com/dmuth\"\u003eFacebook\u003c/a\u003e\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fsplunk-fitbit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmuth%2Fsplunk-fitbit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fsplunk-fitbit/lists"}