Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/logflare/logflare_agent
Watch a file and send new lines to Logflare.
https://github.com/logflare/logflare_agent
Last synced: 7 days ago
JSON representation
Watch a file and send new lines to Logflare.
- Host: GitHub
- URL: https://github.com/logflare/logflare_agent
- Owner: Logflare
- License: mit
- Created: 2019-01-10T19:30:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-07T16:57:07.000Z (almost 2 years ago)
- Last Synced: 2024-10-19T01:46:54.223Z (27 days ago)
- Language: Elixir
- Size: 52.7 KB
- Stars: 23
- Watchers: 3
- Forks: 5
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Logflare Agent
## About
This Elixir app watches a file and sends new lines to Logflare via the API.
## Usage
To install stand alone:
* Install Erlang
* Install Elixir
* `git clone https://github.com/Logflare/logflare-agent.git`
* `mix deps.get`Configure it.
`mix release`
`_build/dev/rel/logflare_agent/bin/logflare_agent start`
Optionally to start the agent at bootup:
`crontab -e`
Add this line to your crontab and save:
`@reboot /FULL_PATH_TO_INSTALL/_build/dev/rel/logflare_agent/bin/logflare_agent start`
## Configure
Change the file to watch and the source key in `./config/config.exs`
```elixir
config :logflare_agent,
sources: [
%{
path: "/home/logflare/app_release/logflare/var/log/erlang.log.1",
source: "SOURCE_ID"
},
%{
path: "/home/logflare/app_release/logflare/var/log/erlang.log.2",
source: "SOURCE_ID"
},
%{
path: "/home/logflare/app_release/logflare/var/log/erlang.log.3",
source: "SOURCE_ID"
},
%{
path: "/home/logflare/app_release/logflare/var/log/erlang.log.4",
source: "SOURCE_ID"
},
%{
path: "/home/logflare/app_release/logflare/var/log/erlang.log.5",
source: "SOURCE_ID"
}
],
url: "https://api.logflare.app",
api_key: "YOUR_API_KEY"
```Your `source`s can be different with each file. This example is useful when watching Erlang log files.
## Installation with Hex
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `logflare_agent` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:logflare_agent, "~> 0.6.2"}
]
end
```Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/logflare_agent](https://hexdocs.pm/logflare_agent).