Skip to content

Commit

Permalink
[DOCS] Add missing run steps for brew installs (#12642)
Browse files Browse the repository at this point in the history
* [DOCS] Add missing run steps

* [DOCS] Fix conditional coding

* Update libbeat/docs/shared-brew-run.asciidoc

* Add brew commands to module run steps

* Apply suggestions from code review

remove note to reviewer.

* remove note to reviewer

* remove extra line

* Remove note to reviewers
  • Loading branch information
dedemorton committed Jul 12, 2019
1 parent 89a6ebd commit ddec37e
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 18 deletions.
2 changes: 2 additions & 0 deletions filebeat/docs/getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ specified. See
{beats-ref}/config-file-permissions.html[Config File Ownership and Permissions]
in the _Beats Platform Reference_.

include::{libbeat-dir}/docs/shared-brew-run.asciidoc[]

*win:*

[source,shell]
Expand Down
7 changes: 7 additions & 0 deletions filebeat/docs/include/enable-modules-command.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
./{beatname_lc} modules enable {modulename}
----
*brew:*
["source","sh",subs="attributes"]
----
{beatname_lc} modules enable {modulename}
----

*linux:*

["source","sh",subs="attributes"]
Expand Down
7 changes: 7 additions & 0 deletions filebeat/docs/include/list-modules-command.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
./{beatname_lc} modules list
----
*brew:*
["source","sh",subs="attributes"]
----
{beatname_lc} modules list
----

*linux:*

["source","sh",subs="attributes"]
Expand Down
7 changes: 7 additions & 0 deletions filebeat/docs/include/run-command.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ service {beatname_lc} start
./{beatname_lc} -e
----
*brew:*
["source","sh",subs="attributes"]
----
{beatname_lc} -e
----

*linux:*

["source","sh",subs="attributes"]
Expand Down
7 changes: 7 additions & 0 deletions filebeat/docs/include/set-paths.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ must include the module and fileset name. For example:
./{beatname_lc} -e -M "nginx.access.var.paths=[/usr/local/var/log/nginx/access.log*]"
----
*brew:*
["source","sh",subs="attributes"]
----
{beatname_lc} -e -M "nginx.access.var.paths=[/usr/local/var/log/nginx/access.log*]"
----

*linux:*

["source","sh",subs="attributes"]
Expand Down
7 changes: 7 additions & 0 deletions filebeat/docs/include/setup-command.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
./{beatname_lc} setup -e
----
*brew:*
["source","sh",subs="attributes"]
----
{beatname_lc} setup -e
----

*win:*

["source","sh",subs="attributes"]
Expand Down
4 changes: 4 additions & 0 deletions heartbeat/docs/getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ configuration file, or run Heartbeat with `--strict.perms=false` specified. See
{beats-ref}/config-file-permissions.html[Config File Ownership and Permissions]
in the _Beats Platform Reference_.

:requires-sudo:
include::{libbeat-dir}/docs/shared-brew-run.asciidoc[]
:requires-sudo!:

*win:*

["source","sh",subs="attributes"]
Expand Down
6 changes: 2 additions & 4 deletions libbeat/docs/dashboards.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ If you've configured the Logstash output, see
<<load-dashboards-logstash>>.
endif::only-elasticsearch[]

ifeval::["{requires-sudo}"=="yes"]

ifdef::requires-sudo[]
include::../../libbeat/docs/shared-note-sudo.asciidoc[]

endif::[]
endif::requires-sudo[]

ifdef::deb_os,rpm_os[]
*deb and rpm:*
Expand Down
38 changes: 37 additions & 1 deletion libbeat/docs/shared-brew-run.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,49 @@ run:

["source","sh",subs="attributes"]
-----
brew services start elastic/tap/{beatname_lc}
brew services start elastic/tap/{beatname_lc}-full
-----

ifndef::requires-sudo[]
To run {beatname_uc} in the foreground instead of running it as a background
service, run:

["source","sh",subs="attributes"]
-----
{beatname_lc} -e
-----
endif::[]

ifdef::requires-sudo[]
To run {beatname_uc} in the foreground instead of running it as a background
service, run:

ifndef::has_modules_command[]
["source","sh",subs="attributes"]
-----
sudo chown root /usr/local/etc/{beatname_lc}/beatname_lc.yml <1>
sudo {beatname_lc} -e
-----
<1> You'll be running {beatname_uc} as root, so you need to change ownership
of the configuration file, or run {beatname_uc} with `--strict.perms=false`
specified. See
{beats-ref}/config-file-permissions.html[Config File Ownership and Permissions]
in the _Beats Platform Reference_.
endif::has_modules_command[]

ifdef::has_modules_command[]
["source","sh",subs="attributes,callouts"]
----------------------------------------------------------------------
sudo chown root /usr/local/etc/{beatname_lc}/{beatname_lc}.yml <1>
sudo chown root /usr/local/etc/{beatname_lc}/modules.d/system.yml <1>
sudo {beatname_lc} -e
----------------------------------------------------------------------
<1> You'll be running {beatname_uc} as root, so you need to change ownership of the
configuration file and any configurations enabled in the `modules.d` directory,
or run {beatname_uc} with `--strict.perms=false` specified. See
{beats-ref}/config-file-permissions.html[Config File Ownership and Permissions]
in the _Beats Platform Reference_.

endif::has_modules_command[]

endif::requires-sudo[]
6 changes: 2 additions & 4 deletions libbeat/docs/shared-template-load.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,9 @@ ifdef::only-elasticsearch[]
:disable_logstash:
endif::only-elasticsearch[]

ifeval::["{requires-sudo}"=="yes"]

ifdef::requires-sudo[]
include::./shared-note-sudo.asciidoc[]

endif::[]
endif::requires-sudo[]

ifdef::deb_os,rpm_os[]
*deb and rpm:*
Expand Down
8 changes: 2 additions & 6 deletions libbeat/docs/step-test-config.asciidoc
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
ifeval::["{requires-sudo}"!="yes"]

ifndef::requires-sudo[]
TIP: To test your configuration file, change to the directory where the
{beatname_uc} binary is installed, and run {beatname_uc} in the foreground with
the following options specified: +./{beatname_lc} test config -e+. Make sure your
config files are in the path expected by {beatname_uc} (see <<directory-layout>>),
or use the `-c` flag to specify the path to the config file.

endif::[]

ifeval::["{requires-sudo}"=="yes"]

ifdef::requires-sudo[]
TIP: To test your configuration file, change to the directory where the
{beatname_uc} binary is installed, and run {beatname_uc} in the foreground with
the following options specified: +sudo ./{beatname_lc} test config -e+. Make sure
Expand All @@ -19,5 +16,4 @@ file. Depending on your OS, you might run into file ownership issues when you
run this test. See
{beats-ref}/config-file-permissions.html[Config File Ownership and Permissions]
in the _Beats Platform Reference_ for more information.

endif::[]
4 changes: 4 additions & 0 deletions metricbeat/docs/gettingstarted.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ or run {beatname_uc} with `--strict.perms=false` specified. See
{beats-ref}/config-file-permissions.html[Config File Ownership and Permissions]
in the _Beats Platform Reference_.

:requires-sudo:
include::{libbeat-dir}/docs/shared-brew-run.asciidoc[]
:requires-sudo!:

*win:*

["source","sh",subs="attributes"]
Expand Down
5 changes: 2 additions & 3 deletions packetbeat/docs/gettingstarted.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -239,21 +239,18 @@ include::{libbeat-dir}/docs/step-configure-kibana-endpoint.asciidoc[]

include::{libbeat-dir}/docs/step-configure-credentials.asciidoc[]

:requires-sudo: yes
include::{libbeat-dir}/docs/step-test-config.asciidoc[]

include::{libbeat-dir}/docs/step-look-at-config.asciidoc[]

[[packetbeat-template]]
=== Step 3: Load the index template in Elasticsearch

:requires-sudo: yes
include::{libbeat-dir}/docs/shared-template-load.asciidoc[]

[[load-kibana-dashboards]]
=== Step 4: Set up the Kibana dashboards

:requires-sudo: yes
include::{libbeat-dir}/docs/dashboards.asciidoc[]

[[packetbeat-starting]]
Expand Down Expand Up @@ -290,6 +287,8 @@ configuration file, or run Packetbeat with `--strict.perms=false` specified. See
{beats-ref}/config-file-permissions.html[Config File Ownership and Permissions]in
the _Beats Platform Reference_.

include::{libbeat-dir}/docs/shared-brew-run.asciidoc[]

*win:*

[source,shell]
Expand Down
1 change: 1 addition & 0 deletions packetbeat/docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
:discuss_forum: beats/{beatname_lc}
:beat_default_index_prefix: {beatname_lc}
:has_ml_jobs: yes
:requires-sudo:
:has_map:
:deb_os:
:rpm_os:
Expand Down

0 comments on commit ddec37e

Please sign in to comment.