README.md
1<p align="center">
2 <img width="256" height="256" src="daggy_logo.svg">
3 <br/>
4 <b>Daggy - Data Aggregation Utility</b>
5</p>
6
7**Daggy - Data Aggregation Utility**. Server-less remote or local data aggregation and streaming.
8
9**Daggy** main goals are simplicity and ease-of-use.
10
11**Daggy** is server-less, cross-platform solution and don't require installation on remote servers. Aggregation and streaming work under SSH transport protocol or via local processes execution.
12
13**Daggy** can be helpful for developers, QA, DevOps and engineers for debug, analyze and control distributed network systems, for example, based on micro-service architecture.
14
15# Getting Started
16
17## Getting Daggy
18
19### Windows
20
21Download installation package (.exe) or portable (.zip) from last [release](https://github.com/synacker/daggy/releases/) page and install it
22
23### MacOS
24
25```bash
26brew install https://raw.githubusercontent.com/synacker/daggy_homebrew/master/daggy.rb
27```
28
29### Fedora 30/31/32
30
31```bash
32sudo dnf install daggy daggy-devel
33```
34
35### Linux
36
37Download .rpm/.deb or portable .zip package from last [release](https://github.com/synacker/daggy/releases/) page and install it
38
39_All daggy dependencies (Qt5, libssh2, libyaml-cpp) are included into separate dir and does not effect system applications._
40
41### Build from source
42
43#### Environment requirenments
44
45[Conan](https://conan.io/), [cmake](https://cmake.org/), [git](https://git-scm.com/) and C++17 compiler.
46
47#### Build steps
48
49```bash
50git clone https://github.com/synacker/daggy.git
51mkdir build
52cd build
53conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
54conan install ../daggy --build=missing
55conan build ../daggy
56cmake install
57```
58
59#### Check installation
60
61```bash
62daggy --help
63Usage: daggy [options] *.yaml|*.yml|*.json
64
65Options:
66 -o, --output <folder> Set output folder
67 -f, --format <json|yaml> Source format
68 -i, --stdin Read data aggregation sources from stdin
69 -t, --timeout <time in ms> Auto complete timeout
70 -h, --help Displays help on commandline options.
71 --help-all Displays help including Qt specific options.
72 -v, --version Displays version information.
73
74Arguments:
75 file data aggregation sources file
76```
77
78## Getting Started with data aggregation and streaming
79
80### Simple Data Aggregation Source
81
82#### Create simple.yaml
83
84```yaml
85sources:
86 localhost:
87 type: local
88 commands:
89 pingYa:
90 exec: ping ya.ru
91 extension: log
92```
93
94#### Run daggy
95```bash
96daggy simple.yaml
97```
98
99#### Check console output
100
101```text
10223:07:23:977 | AppStat | Start aggregation in 01-04-20_23-07-23-977_simple
10323:07:23:977 | ProvStat | localhost | New state: Started
10423:07:23:977 | CommStat | localhost | pingYa | New state: Starting
10523:07:23:977 | CommStat | localhost | pingYa | New state: Started
106```
107
108_There are all commands from **simple.yaml/simple.json** are streams in **01-04-20\_23-07-23-977\_simple** with output files_
109
110#### Tailing streams from Simple Data Source
111
112```text
113tail -f 01-04-20_23-07-23-977_simple/*
11464 bytes from ya.ru (87.250.250.242): icmp_seq=99 ttl=249 time=21.2 ms
11564 bytes from ya.ru (87.250.250.242): icmp_seq=100 ttl=249 time=18.8 ms
11664 bytes from ya.ru (87.250.250.242): icmp_seq=101 ttl=249 time=23.5 ms
11764 bytes from ya.ru (87.250.250.242): icmp_seq=102 ttl=249 time=18.8 ms
11864 bytes from ya.ru (87.250.250.242): icmp_seq=103 ttl=249 time=18.8 ms
11964 bytes from ya.ru (87.250.250.242): icmp_seq=104 ttl=249 time=17.4 ms
12064 bytes from ya.ru (87.250.250.242): icmp_seq=105 ttl=249 time=17.4 ms
12164 bytes from ya.ru (87.250.250.242): icmp_seq=106 ttl=249 time=20.1 ms
12264 bytes from ya.ru (87.250.250.242): icmp_seq=107 ttl=249 time=25.8 ms
12364 bytes from ya.ru (87.250.250.242): icmp_seq=108 ttl=249 time=35.1 ms
12464 bytes from ya.ru (87.250.250.242): icmp_seq=109 ttl=249 time=21.1 ms
125```
126
127#### Stop data aggregation and streaming
128
129_Type **CTRL+C** for stopping data aggregation and streaming. Type **CTRL+C** twice for hard stop application, without waiting cancelation of child local and remote processes._
130
131```text
13223:07:23:977 | AppStat | Start aggregation in 01-04-20_23-07-23-977_simple
13323:07:23:977 | ProvStat | localhost | New state: Started
13423:07:23:977 | CommStat | localhost | pingYa | New state: Starting
13523:07:23:977 | CommStat | localhost | pingYa | New state: Started
136^C23:17:56:667 | ProvStat | localhost | New state: Finishing
13723:17:56:668 | CommStat | localhost | pingYa | New state: Finished. Exit code: 0
13823:17:56:668 | ProvStat | localhost | New state: Finished
13923:17:56:668 | AppStat | Stop aggregation in 01-04-20_23-07-23-977_simple
140```
141
142#### Investigate aggregated data
143
144```bash
145ls -l 01-04-20_23-07-23-977_simple/
146-rw-r--r-- 1 muxa muxa 45574 апр 1 23:17 localhost-pingYa.log
147```
148
149### Example of Data Aggregation Sources with multiple commands and remote data aggregation and streaming
150
151```yaml
152aliases:
153 - &my_commands
154 pingYa:
155 exec: ping ya.ru
156 extension: log
157 pingGoo:
158 exec: ping goo.gl
159 extension: log
160
161 - &ssh_auth
162 user: {{env_USER}}
163 passphrase: {{env_PASSWORD}}
164
165sources:
166 localhost:
167 type: local
168 commands: *my_commands
169 remotehost:
170 host: 192.168.1.9
171 type: ssh2
172 parameters: *ssh_auth
173 commands: *my_commands
174 remotehost2:
175 host: 192.168.1.9
176 type: ssh2
177 parameters: *ssh_auth
178 commands: *my_commands
179 remotehost3:
180 host: 192.168.1.9
181 type: ssh2
182 parameters: *ssh_auth
183 commands: *my_commands
184```
185