-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from ezpaarse-project/docs
Docs
- Loading branch information
Showing
99 changed files
with
1,853 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,63 @@ | ||
# bot-ua-detector | ||
|
||
Mark ECs as robots if their user-agent string match a regex in the COUNTER robot list | ||
Mark ECs as robots if their user-agent string match a regex in the COUNTER [robot list](https://raw.githubusercontent.com/atmire/COUNTER-Robots/master/generated/COUNTER_Robots_list.txt). | ||
|
||
## Enriched fields | ||
|
||
| Name | Type | Description | | ||
| --- | --- | --- | | ||
| robot | boolean | Is robot or not. | | ||
|
||
## Prerequisites | ||
|
||
**You must use bot-ua-detector after filter, parser, deduplicator middleware.** | ||
|
||
## Headers | ||
|
||
+ **robot-refresh-timeout** : Robot refresh time *(default: 5000ms)* | ||
|
||
## Configuration | ||
## How to use | ||
|
||
### ezPAARSE admin interface | ||
|
||
You can add or remove bot-ua-detector by default to all your enrichments. To do this, go to the middleware section of administration. | ||
|
||
![image](./docs/admin-interface.png) | ||
|
||
### ezPAARSE process interface | ||
|
||
You can use bot-ua-detector for an enrichment process. | ||
|
||
+ ezPAARSE-Middlewares : **bot-ua-detector** | ||
![image](./docs/process-interface.png) | ||
|
||
### Example : | ||
### ezp | ||
|
||
You can use bot-ua-detector for an enrichment process with [ezp](https://github.com/ezpaarse-project/node-ezpaarse) like this: | ||
|
||
```bash | ||
# enrich with one file | ||
ezp process <path of your file> \ | ||
--host <host of your ezPAARSE instance> \ | ||
--settings <settings-id> \ | ||
--header "ezPAARSE-Middlewares: bot-ua-detector" \ | ||
--out ./result.csv | ||
|
||
# enrich with multiples files | ||
ezp bulk <path of your directory> \ | ||
--host <host of your ezPAARSE instance> \ | ||
--settings <settings-id> \ | ||
--header "ezPAARSE-Middlewares: bot-ua-detector" | ||
|
||
``` | ||
|
||
### curl | ||
|
||
You can use bot-ua-detector for an enrichment process with curl like this: | ||
|
||
```bash | ||
curl -v -X POST http://localhost:59599 | ||
-H "ezPAARSE-Middlewares: bot-ua-detector" | ||
-F "files[]=@access.log" | ||
curl -X POST -v http://localhost:59599 \ | ||
-H "ezPAARSE-Middlewares: bot-ua-detector" \ | ||
-H "Log-Format-Ezproxy: <line format>" \ | ||
-F "file=@<log file path>" | ||
|
||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,100 @@ | ||
# cut | ||
|
||
Separates any unique field into two or more distinct fields, based on a given separator or regular expression | ||
Separates any unique field into two or more distinct fields, based on a given separator or regular expression. | ||
|
||
**This middleware is activated by default.** | ||
No config is set by default. | ||
|
||
## Enriched fields | ||
|
||
| Name | Type | Description | | ||
| --- | --- | --- | | ||
| destinationFields | String | custom fields | | ||
|
||
## Prerequisites | ||
|
||
Your EC needs sourceField that exist. | ||
|
||
**You must use cut after filter, parser, deduplicator middleware.** | ||
|
||
## Headers | ||
|
||
+ **extract** : This header takes 3 parameters which are ``sourceField``, ``expression`` and ``destinationFields``, e.g: ``sourceField=>expression=>destinationFields`` | ||
|
||
### Examples | ||
## How to use | ||
|
||
+ Use with regex : | ||
### ezPAARSE admin interface | ||
|
||
> In this example we want to retrieve separately the last name and the first name of a user so the login is lastName.firstName. | ||
``` | ||
You can add or remove cut by default to all your enrichments. To do this, go to the middleware section of administration. | ||
|
||
![image](./docs/admin-interface.png) | ||
|
||
### ezPAARSE process interface | ||
|
||
You can use cut for an enrichment process. | ||
|
||
![image](./docs/process-interface.png) | ||
|
||
### ezp | ||
|
||
You can use cut for an enrichment process with [ezp](https://github.com/ezpaarse-project/node-ezpaarse) like this: | ||
|
||
```bash | ||
|
||
# Use with split function | ||
|
||
# enrich with one file | ||
ezp process <path of your file> \ | ||
--host <host of your ezPAARSE instance> \ | ||
--settings <settings-id> \ | ||
--header "ezPAARSE-Middlewares: cut" \ | ||
--header "extract: email => split(@) => identifiant,domainName" \ | ||
--out ./result.csv | ||
|
||
# enrich with multiples files | ||
ezp bulk <path of your directory> \ | ||
--host <host of your ezPAARSE instance> \ | ||
--settings <settings-id> \ | ||
--header "ezPAARSE-Middlewares: cut" \ | ||
--header "extract: email => split(@) => identifiant,domainName" | ||
|
||
# Use with regex | ||
|
||
# enrich with one file | ||
ezp process <path of your file> \ | ||
--host <host of your ezPAARSE instance> \ | ||
--settings <settings-id> \ | ||
--header "ezPAARSE-Middlewares: cut" \ | ||
--header "extract: login => /^([a-z]+)\.([a-z]+)$/ => lastName,firstName" \ | ||
--out ./result.csv | ||
|
||
# enrich with multiples files | ||
ezp bulk <path of your directory> \ | ||
--host <host of your ezPAARSE instance> \ | ||
--settings <settings-id> \ | ||
--header "ezPAARSE-Middlewares: cut" \ | ||
--header "extract: login => /^([a-z]+)\.([a-z]+)$/ => lastName,firstName" | ||
|
||
curl -v -X POST http://localhost:59599 | ||
-H "ezPAARSE-Middlewares: cut" | ||
-H "extract: login => /^([a-z]+)\.([a-z]+)$/ => lastName,firstName" \ | ||
-F "files[]=@access.log" | ||
``` | ||
|
||
+ Use with split function : | ||
### curl | ||
|
||
> In this example we want to retrieve different username and domain name compared to an email address | ||
You can use cut for an enrichment process with curl like this: | ||
|
||
```bash | ||
curl -v -X POST http://localhost:59599 | ||
-H "ezPAARSE-Middlewares: cut" | ||
|
||
# Use with split function | ||
curl -X POST -v http://localhost:59599 \ | ||
-H "ezPAARSE-Middlewares: cut" \ | ||
-H "extract: email => split(@) => identifiant,domainName" \ | ||
-F "files[]=@access.log" | ||
``` | ||
-H "Log-Format-Ezproxy: <line format>" \ | ||
-F "file=@<log file path>" | ||
|
||
# Use with regex | ||
curl -X POST -v http://localhost:59599 \ | ||
-H "ezPAARSE-Middlewares: cut" \ | ||
-H "extract: login => /^([a-z]+)\.([a-z]+)$/ => lastName,firstName" \ | ||
-H "Log-Format-Ezproxy: <line format>" \ | ||
-F "file=@<log file path>" | ||
|
||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.