From 8ea99edbd602bdc9376524f74c0a99a1b3f9054d Mon Sep 17 00:00:00 2001 From: Monica Sarbu Date: Thu, 24 Sep 2015 23:35:49 +0200 Subject: [PATCH] Add version variable to the packetbeat version --- Makefile | 1 - docs/gettingstarted.asciidoc | 29 ++--- docs/gettingstarted.in.asciidoc | 190 ----------------------------- docs/index.asciidoc | 1 + scripts/generate_gettingstarted.sh | 43 ------- 5 files changed, 11 insertions(+), 253 deletions(-) delete mode 100644 docs/gettingstarted.in.asciidoc delete mode 100755 scripts/generate_gettingstarted.sh diff --git a/Makefile b/Makefile index 213056bf1ad3..891f959efe8a 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,6 @@ env/bin/activate: requirements.txt .PHONY: gen gen: env - ./scripts/generate_gettingstarted.sh docs/gettingstarted.in.asciidoc docs/gettingstarted.asciidoc . env/bin/activate && python scripts/generate_template.py etc/fields.yml etc/packetbeat.template.json . env/bin/activate && python scripts/generate_field_docs.py etc/fields.yml docs/fields.asciidoc diff --git a/docs/gettingstarted.asciidoc b/docs/gettingstarted.asciidoc index 61791fb80118..895a338c09e3 100644 --- a/docs/gettingstarted.asciidoc +++ b/docs/gettingstarted.asciidoc @@ -1,12 +1,3 @@ -//// - -This file is generated! Edit gettingstarted.in.asciidoc instead and then -re-generate this file with: - - ../scripts/generate_gettingstarted.sh gettingstarted.in.asciidoc gettingstarted.asciidoc - -//// - [[packetbeat-getting-started]] == Getting started @@ -31,29 +22,29 @@ servers: deb: -[source,shell] +["source","sh",subs="attributes,callouts"] ---------------------------------------------------------------------- sudo apt-get install libpcap0.8 -curl -L -O https://download.elasticsearch.org/beats/packetbeat/packetbeat_1.0.0-beta3_amd64.deb -sudo dpkg -i packetbeat_1.0.0-beta3_amd64.deb +curl -L -O https://download.elasticsearch.org/beats/packetbeat/packetbeat_{version}_amd64.deb +sudo dpkg -i packetbeat_{version}_amd64.deb ---------------------------------------------------------------------- rpm: -[source,shell] +["source","sh",subs="attributes,callouts"] ---------------------------------------------------------------------- sudo yum install libpcap -curl -L -O https://download.elasticsearch.org/beats/packetbeat/packetbeat-1.0.0-beta3-x86_64.rpm -sudo rpm -vi packetbeat-1.0.0-beta3-x86_64.rpm +curl -L -O https://download.elasticsearch.org/beats/packetbeat/packetbeat-{version}-x86_64.rpm +sudo rpm -vi packetbeat-{version}-x86_64.rpm ---------------------------------------------------------------------- mac: -[source,shell] +["source","sh",subs="attributes,callouts"] ---------------------------------------------------------------------- -curl -L -O https://download.elasticsearch.org/beats/packetbeat/packetbeat-1.0.0-beta3-darwin.tgz -tar xzvf packetbeat-1.0.0-beta3-darwin.tgz +curl -L -O https://download.elasticsearch.org/beats/packetbeat/packetbeat-{version}-darwin.tgz +tar xzvf packetbeat-{version}-darwin.tgz ---------------------------------------------------------------------- NOTE: We also provide 32bits images. You can get them from our @@ -148,7 +139,7 @@ mac: [source,shell] ---------------------------------------------------------------------- -cd beats-1.0.0-beta3-darwin +cd beats-{version}-darwin curl -XPUT 'http://localhost:9200/_template/packetbeat' -d@packetbeat.template.json ---------------------------------------------------------------------- diff --git a/docs/gettingstarted.in.asciidoc b/docs/gettingstarted.in.asciidoc deleted file mode 100644 index 105ca393772e..000000000000 --- a/docs/gettingstarted.in.asciidoc +++ /dev/null @@ -1,190 +0,0 @@ -[[packetbeat-getting-started]] -== Getting started - -The best way to understand the value of an network packet analytics system like -Packetbeat is to try it on your own traffic. - -Follow the steps to get started with your own Packetbeat setup: - - * Install the Packetbeat shippers on your servers so that they capture the network traffic. <> - * Install Elasticsearch for storage and indexing the data. {libbeat}getting-started.html#elasticsearch-installation[More details] - * Install Kibana for the UI. {libbeat}/getting-started.html#kibana-installation[More details] - * Install optionally Logstash. {libbeat}/getting-started.html#logstash[More details] - * Load sample Kibana dashboards to get it started. <> - - -[[packetbeat-installation]] -=== Packetbeat installation - -Now that you have Elasticsearch running, I'm sure you are eager to put some -data in it. For this, install the Packetbeat shippers on your application -servers: - -deb: - -[source,shell] ----------------------------------------------------------------------- -sudo apt-get install libpcap0.8 -curl -L -O https://download.elasticsearch.org/beats/packetbeat/packetbeat_$PB_VERSION_amd64.deb -sudo dpkg -i packetbeat_$PB_VERSION_amd64.deb ----------------------------------------------------------------------- - -rpm: - -[source,shell] ----------------------------------------------------------------------- -sudo yum install libpcap -curl -L -O https://download.elasticsearch.org/beats/packetbeat/packetbeat-$PB_VERSION-x86_64.rpm -sudo rpm -vi packetbeat-$PB_VERSION-x86_64.rpm ----------------------------------------------------------------------- - - -mac: - -[source,shell] ----------------------------------------------------------------------- -curl -L -O https://download.elasticsearch.org/beats/packetbeat/packetbeat-$PB_VERSION-darwin.tgz -tar xzvf packetbeat-$PB_VERSION-darwin.tgz ----------------------------------------------------------------------- - -NOTE: We also provide 32bits images. You can get them from our -https://www.elastic.co/downloads/beats/packetbeat[download page]. - -Before starting the shipper, edit the configuration file. For rpm and deb the -configuration file is `/etc/packetbeat/packetbeat.yml`. For mac the -configuration file is found in the archive you just downloaded. - -First, select the network interface from which to capture the traffic. On -Linux, Packetbeat supports capturing all messages sent or received by the -server on which it is installed. For this, use `any` as the device: - -[source,yaml] ----------------------------------------------------------------------- -interfaces: - # Select on which network interfaces to sniff. You can use the "any" - # keyword to sniff on all connected interfaces. - device: any ----------------------------------------------------------------------- - -Note that on OS X, capturing from the `any` device doesn't work. You would -typically use either `lo0` or `en0` depending on which traffic you want to -capture. - -In the next section, configure the ports on which Packetbeat can find each -protocol. If you use any non-standard ports, add them here. Otherwise, the -default values should do just fine. - -[source,yaml] ----------------------------------------------------------------------- -protocols: - # Configure which protocols to monitor and on which ports are they - # running. You can disable a given protocol by commenting out its - # configuration. - http: - ports: [80, 8080, 8081, 5000, 8002] - - memcache: - ports: [11211] - - mysql: - ports: [3306] - - redis: - ports: [6379] - - pgsql: - ports: [5432] - - thrift: - ports: [9090] ----------------------------------------------------------------------- - -Set the IP address and port where the shipper can find the Elasticsearch -installation: - -[source,yaml] ----------------------------------------------------------------------- -output: - - elasticsearch: - # Uncomment out this option if you want to output to Elasticsearch. The - # default is false. - enabled: true - - # Set the host and port where to find Elasticsearch. - host: 192.168.1.42 - port: 9200 - - # Comment this option if you don't want to store the topology in - # Elasticsearch. The default is false. - save_topology: true ----------------------------------------------------------------------- - -Before starting Packetbeat, you need to load the -http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html[index -template], which is used to let Elasticsearch know which fields should be analyzed -in which way. - -The recommended template file is installed by the Packetbeat packages. Load it with the -following command: - -deb or rpm: - -[source,shell] ----------------------------------------------------------------------- -curl -XPUT 'http://localhost:9200/_template/packetbeat' -d@/etc/packetbeat/packetbeat.template.json ----------------------------------------------------------------------- - -mac: - -[source,shell] ----------------------------------------------------------------------- -cd beats-1.0.0-beta3-darwin -curl -XPUT 'http://localhost:9200/_template/packetbeat' -d@packetbeat.template.json ----------------------------------------------------------------------- - -where `localhost:9200` is the IP and port where Elasticsearch is listening on -Replace `packetbeat` with the beat name that you are running. - -You are now ready to start Packetbeat: - -deb: - -[source,shell] ----------------------------------------------------------------------- -sudo /etc/init.d/packetbeat start ----------------------------------------------------------------------- - -rpm: - -[source,shell] ----------------------------------------------------------------------- -sudo /etc/init.d/packetbeat start ----------------------------------------------------------------------- - -mac: - -[source,shell] ----------------------------------------------------------------------- -sudo ./packetbeat -e -c packetbeat.yml -d "publish" ----------------------------------------------------------------------- - -Packetbeat is now ready to capture data from your network traffic. You can test -that it works by creating a simple HTTP request. For example: - -[source,shell] ----------------------------------------------------------------------- -curl http://www.elastic.co/ > /dev/null ----------------------------------------------------------------------- - -Now check that the data is present in Elasticsearch with the following command: - -[source,shell] ----------------------------------------------------------------------- -curl -XGET 'http://localhost:9200/packetbeat-*/_search?pretty' ----------------------------------------------------------------------- - -Make sure to replace `localhost:9200` with the address of your Elasticsearch -instance. It should return data about the HTTP transaction you just created. - -Enjoy! diff --git a/docs/index.asciidoc b/docs/index.asciidoc index 5cc9c9895b3b..8db53604a755 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -1,5 +1,6 @@ = Packetbeat reference :libbeat: http://www.elastic.co/guide/en/beats/libbeat/master +:version: 1.0.0-beta3 include::./overview.asciidoc[] diff --git a/scripts/generate_gettingstarted.sh b/scripts/generate_gettingstarted.sh deleted file mode 100755 index d168d64bb755..000000000000 --- a/scripts/generate_gettingstarted.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -INPUT=$1 -OUTPUT=$2 - -PB_VERSION=1.0.0-beta3 -ES_VERSION=1.5.2 -KIBANA_VERSION=4.0.2 -DASHBOARDS_VERSION=1.0.0-beta2 - -usage() { - echo "Usage: $0 etc/gettingstarted.in.asciidoc etc/gettingstarted.asciidoc" -} - -if [ -z $INPUT ]; then - usage - exit 1 -fi - -if [ -z $OUTPUT ]; then - usage - exit 1 -fi - -cat << EOF > $OUTPUT -//// - -This file is generated! Edit gettingstarted.in.asciidoc instead and then -re-generate this file with: - - ../scripts/generate_gettingstarted.sh gettingstarted.in.asciidoc gettingstarted.asciidoc - -//// - -EOF - -cat $INPUT >> $OUTPUT - -sed -i.bk "s/\$PB_VERSION/$PB_VERSION/g" $OUTPUT -sed -i.bk "s/\$ES_VERSION/$ES_VERSION/g" $OUTPUT -sed -i.bk "s/\$KIBANA_VERSION/$KIBANA_VERSION/g" $OUTPUT -sed -i.bk "s/\$DASHBOARDS_VERSION/$DASHBOARDS_VERSION/g" $OUTPUT -rm $OUTPUT.bk