<commit_before># vagrant-goaccess-awscf
Vagrant box for parsing and analysing AWS CloudFront log using GoAccess

## Dependencies

- [Vagrant](https://www.vagrantup.com)
- [Virtualbox](https://www.virtualbox.org)

## How-To

**Clone this repo**
```cmd
git clone https://github.com/fredbourni/vagrant-goaccess-awscf.git
```

**Start the VM**
```cmd
cd vagrant-goaccess-awscf
vagrant up
```

**Connect to the VM**

- Use [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) or any other SSH client using `127.0.0.1` port `2222` using `vagrant` as username and password.

**Fetch logs file from Amazon**

```bash
# Configure the AWS Command Line Interface with your API credential
aws configure
# Let's go in the shared folder
cd /vagrant
# Be clean and create a 'logs' folder
mkdir logs
cd logs
# Sync the log files in the 'logs' directory
aws s3 sync s3://bucket-having-cloudfront-logs/ ./
```

**Generate your first report**

```bash
zcat /vagrant/logs/yoursite-prefix.com/*.gz | goaccess -o /usr/share/nginx/html/index.html
```

This will create an HTML report available at: [http://127.0.0.1/](http://127.0.0.1/)

## GoAccess configuration

- The default configuration is being patch by [goaccess/cloudfront.diff!](goaccess/cloudfront.diff)
- To tweak the configuration at your taste, please edit: /usr/local/etc/goaccess.conf

## Documentation
<commit_msg>Some modification to README<commit_after># vagrant-goaccess-awscf
Vagrant box for parsing and analysing AWS CloudFront logs using GoAccess

## Dependencies

- [Vagrant](https://www.vagrantup.com)
- [Virtualbox](https://www.virtualbox.org)

## How-To

**Clone this repo**
```cmd
git clone https://github.com/fredbourni/vagrant-goaccess-awscf.git
```

**Start the VM**
```cmd
cd vagrant-goaccess-awscf
vagrant up
```

**Connect to the VM**

- Use [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) or any other SSH client using `127.0.0.1` port `2222` using `vagrant` as username and password.

**Fetch your logs file from Amazon S3**

```bash
# Configure the AWS Command Line Interface with your API credential
aws configure
# Let's switch to the pre-shared vagrant folder
cd /vagrant
# Be clean and create a 'logs' folder
mkdir logs
cd logs
# Sync the log files in that directory
aws s3 sync s3://bucket-having-cloudfront-logs/ ./
```

**Generate your first report**

```bash
zcat /vagrant/logs/yoursite-prefix.com/*.gz | goaccess -o /usr/share/nginx/html/index.html
```

This will create an HTML report available at: [http://127.0.0.1/](http://127.0.0.1/)

## GoAccess configuration

- The default configuration is being patch by [goaccess/cloudfront.diff](goaccess/cloudfront.diff)
- To tweak the configuration at your taste, please edit: /usr/local/etc/goaccess.conf

## Documentation

{'fraction_non_alphanumeric': 0.13486370157819225, 'fraction_numerical': 0.01757532281205165, 'mean_word_length': 4.292220113851992, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3328494', 'n_tokens_mistral': 990, 'n_tokens_neox': 929, 'n_words': 289}