diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2023-09-08 07:45:51 +0300 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2023-09-08 07:45:51 +0300 |
| commit | 85780654df870dc4170b93a8ed5a5dbfa917fe5d (patch) | |
| tree | 1d2843e212def6bcdead71ef8c814e8cf55f31a5 /doc/examples.md | |
| parent | 51747cc62ae47af7d369e3e43d41f156835e9dfa (diff) | |
| parent | d6efc889f1dc9582ba8006633376c022c945a126 (diff) | |
Merge branch 'develop'
Diffstat (limited to 'doc/examples.md')
| -rw-r--r-- | doc/examples.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/examples.md b/doc/examples.md index 26ce002..4937cc5 100644 --- a/doc/examples.md +++ b/doc/examples.md @@ -151,6 +151,25 @@ You can also use a file input pipe as follows: dmap 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,lifetimeConnections group by $hostname order by max($cgocalls)' ``` +### Aggregating CSV files + +In essence, this works exactly like aggregating logs. All files operated on must be valid CSV files and the first line of the CSV must be the header. E.g.: + +```shell +% cat example.csv +name,lastname,age,profession +Michael,Jordan,40,Basketball player +Michael,Jackson,100,Singer +Albert,Einstein,200,Physician +% dmap --query 'select lastname,name where age > 40 logformat csv outfile result.csv' example.csv +% cat result.csv +lastname,name +Jackson,Michael +Einstein,Albert +``` + +DMap can also be used to query and aggregate CSV files from remote servers. + ### Other serverless commands The serverless mode works transparently with all other DTail commands. Here are some examples: |
