<commit_before># logentries-migrator
Import-export tags and alerts from a Logentries account to an other.

## Usage
The migrator requires a working `NodeJS >= 4` environment and an NPM install.

```bash
npm install
chmod +x ./migrator
```

You can find 


### Export
You can export alerts and tags from an account in `json` format. It could be used as a backup or a source for importing later.

`migrator export --account_key 11111111-2222-3333-4444-555555555555 --output output.json`

#### Arguments
```bash
--account_key  Account key to get the data from                     [required]
--output       Filename to export the data                          [required]
--help         Show help                                             [boolean]
```

### Import
You can import alerts and tags from an account directly or from a previously saved `json` file. You can also save the exported settings to a file without using the `export` command explicitly.

`migrator import --account_key 11111111-2222-3333-4444-555555555555 --target_account_key 91111111-2222-3333-4444-555555555555 --log_set 'Sample logset' --log 'Sample logs' --alert_emails '<EMAIL>' --alert_rate_count 11 --alert_rate_range 'hour' --alert_limit_count 22 --alert_limit_range 'hour' --output 'backup.json'`

#### Arguments

```bash
--account_key         Account key to get the data from. This or the input<commit_msg>docs(readme): add account key description<commit_after># logentries-migrator
Import-export tags and alerts from a Logentries account to an other.

## Usage
The migrator requires a working `NodeJS >= 4` environment and an NPM install.

```bash
npm install
chmod +x ./migrator
```

All migration commands need an account id which you can find in the Logentries UI *Account settings / Profile / Account key*. 

### Export
You can export alerts and tags from an account in `json` format. It could be used as a backup or a source for importing later.

`migrator export --account_key 11111111-2222-3333-4444-555555555555 --output output.json`

#### Arguments
```bash
--account_key  Account key to get the data from                     [required]
--output       Filename to export the data                          [required]
--help         Show help                                             [boolean]
```

### Import
You can import alerts and tags from an account directly or from a previously saved `json` file. You can also save the exported settings to a file without using the `export` command explicitly.

`migrator import --account_key 11111111-2222-3333-4444-555555555555 --target_account_key 91111111-2222-3333-4444-555555555555 --log_set 'Sample logset' --log 'Sample logs' --alert_emails '<EMAIL>' --alert_rate_count 11 --alert_rate_range 'hour' --alert_limit_count 22 --alert_limit_range 'hour' --output 'backup.json'`

#### Arguments

```bash
--account_key         Account key to get the data from. This or the input
{'fraction_non_alphanumeric': 0.09003436426116838, 'fraction_numerical': 0.06941580756013746, 'mean_word_length': 3.020718232044199, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 12, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '156692', 'n_tokens_mistral': 956, 'n_tokens_neox': 776, 'n_words': 342}