{"id":27334879,"url":"https://github.com/dmuth/splunk-osx-magic-mouse-battery","last_synced_at":"2025-04-12T14:46:33.817Z","repository":{"id":27369429,"uuid":"30844936","full_name":"dmuth/splunk-osx-magic-mouse-battery","owner":"dmuth","description":"A Splunk App to track the battery level of your Apple Magic Mouse","archived":false,"fork":false,"pushed_at":"2020-09-03T22:22:27.000Z","size":40,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-02T06:07:40.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/dmuth.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":"2015-02-15T22:35:20.000Z","updated_at":"2016-05-27T15:02:20.000Z","dependencies_parsed_at":"2022-07-24T15:01:54.990Z","dependency_job_id":null,"html_url":"https://github.com/dmuth/splunk-osx-magic-mouse-battery","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/dmuth%2Fsplunk-osx-magic-mouse-battery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fsplunk-osx-magic-mouse-battery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fsplunk-osx-magic-mouse-battery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmuth%2Fsplunk-osx-magic-mouse-battery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmuth","download_url":"https://codeload.github.com/dmuth/splunk-osx-magic-mouse-battery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248585248,"owners_count":21128974,"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":"2025-04-12T14:46:33.047Z","updated_at":"2025-04-12T14:46:33.811Z","avatar_url":"https://github.com/dmuth.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Splunk OSX Magic Mouse Battery\n\nA Splunk App to monitor the battery level on your Apple Magic Mouse.\n\nI wrote this app shortly after switching from a wired mouse to a Magic Mouse, and\nwanted to see how quickly my battery levels dropped. (yeah, I'm kind of a nerd, I know)\n\n![image](img/splunk-apple-magic-mouse-battery-levels.png)\n\n\n## What's Splunk?\n\nSplunk is an amazing app that lets you monitor your logfiles and perform analytics on them.  You can monitor other kinds of data, such as the output of the ping command, which is what this app does.  A free copy of Splunk Enterprise [can be downloaded at Splunk.com](http://www.splunk.com/)\n\n\n## Installation\n\nThis assumes you are running this on a machine with Vagrant and Virtual box installed.  If you are running this on a machine \nthat has already been created, simply remove the references to Vagrant.\n\n- Download this app:\n\t- `git clone git@github.com:dmuth/splunk-network-monitor.git`\n- Start Vagrant with `vagrant up`\n- SSH into the Vagrant instance with `vagrant ssh`\n- Install Splunk with `sudo /vagrant/bin/install_splunk.sh`\n    - Agree to the license and then watch Spkunk start\n    - **Note:** that you'll need a Splunk .deb file named `splunk.deb` in the current directory\n- Deploy this app:\n\t- `sudo /vagrant/bin/deploy_symlink.sh $SPLUNK_ROOT` if you'd like to have a symlink pointing to this directory\n\t- `sudo /vagrant/bin/deploy.sh $SPLUNK_ROOT` if you'd like to have this directory copied into $SPLUNK_HOME/Network-Monitor/\n- Restart Splunk:\n    - `sudo $SPLUNK_HOME/bin/splunk restart`\n- Log into Splunk on [http://localhost:8000/](http://localhost:8000/) and click \"App: Network Monitor\" to see your connectivity reports.\n\n\nIf you are already running Splunk natively on your machine, you can skip straight to the \"deploy\" section.\n\n\n## Usage\n\nFor now, query `index=main sourcetype=osx-magic-mouse-battery-level`.\n\nGraphs will follow in a future release.\n\n\n## How does it work?\n\nThis app periodically runs a script with a command similar to:\n\n`ioreg -n \"BNBMouseDevice\" | grep -i \"batterypercent\" |grep -v \"{\" | sed 's/[^[:digit:]]//g'`\n\n...that returns the current battery level as an integer between 0 and 100.\n\n\n## Compatibility\n\nThis has been written for (and tested on) Splunk 6.2\n\nSplunk 6.2, in turn, has been tested on Ubuntu 14.04 LTS and Macintosh OS/X 10.10.1.  **If you would like to run this in Windows**, your best bet is just to set up Ubuntu 14.04 LTS in a VM.  256 Megs of RAM should be sufficient.\n\n\n\n## TODO\n\nThings I might implement in the future:\n- Build some graphs and ship them with this app.\n\n\n    \n## Questions, comments, abuse, and offers of employment\n\nHit me up via [email](mailto:dmuth@dmuth.org), or [Facebook](http://www.facebook.com/dmuth).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fsplunk-osx-magic-mouse-battery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmuth%2Fsplunk-osx-magic-mouse-battery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmuth%2Fsplunk-osx-magic-mouse-battery/lists"}