logstash-plugins / logstash-filter-mutate

Apache License 2.0
16 stars 75 forks source link

Docs: Use backtick notation for %{fieldname} references #62

Closed magnusbaeck closed 8 years ago

magnusbaeck commented 8 years ago

Apart from being consistent with the rest of the Logstash documentation, this should make the asciidoc generator happier so it won't skip the line with the non-backticked %{fieldname} reference when emitting the asciidoc file. This fixes #41.

I've tried to verify that this micropatch actually fixes the asciidoc rendering problem but I'm blocked by https://discuss.elastic.co/t/missing-logstash-home-when-running-rake-docs-generate-docs/35949.

elasticsearch-release commented 8 years ago

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'.

magnusbaeck commented 8 years ago

Okay, something really weird has happened. It seems one of my commits (07cbfff) has ended up on the master branch of github.com/logstash-plugins/logstash-filter-mutate even though I'm pretty sure I never pushed that commit anywhere.

Shell transcript follows. Note how the very first commit I run git show on is the one that ended up in the master branch of this git. I amend that commit twice to fix issues with the commit messages and eventually push to the backticks branch of my fork. A few minutes later I fetch from the upstream git (not my fork) and surprisingly see commit 07cbfff in the master branch.

$ git show
commit 07cbfff5484017a36f842f428912eeefed6629df
Author: Magnus Bäck <magnus@noun.se>
Date:   Sun Nov 29 21:54:27 2015 +0100

    Docs: Use backtick notation for %{varname} references.

    Apart from being consistent with the rest of the Logstash
    documentation, this should make the asciidoc generator happier
    so it won't skip the line with the un-backticked %{varname}
    reference when emitting the asciidoc file.

    Fixes 41

diff --git a/lib/logstash/filters/mutate.rb b/lib/logstash/filters/mutate.rb
index 9a7857c..9ad37fa 100644
--- a/lib/logstash/filters/mutate.rb
+++ b/lib/logstash/filters/mutate.rb
@@ -33,7 +33,7 @@ class LogStash::Filters::Mutate < LogStash::Filters::Base
   # filters.
   config :remove, :validate => :array, :deprecated => true

-  # Replace a field with a new value. The new value can include %{foo} strings
+  # Replace a field with a new value. The new value can include `%{foo}` strings
   # to help you build a new value from other parts of the event.
   #
   # Example:
$ git branch
* backticks
  master
$ git commit --amend
[backticks 29bdc10] Docs: Use backtick notation for %{fieldname} references.
 Date: Sun Nov 29 21:54:27 2015 +0100
 1 file changed, 1 insertion(+), 1 deletion(-)
$ git show
commit 29bdc107f381c5655f00afe229c2bb9dd839ffcc
Author: Magnus Bäck <magnus@noun.se>
Date:   Sun Nov 29 21:54:27 2015 +0100

    Docs: Use backtick notation for %{fieldname} references.

    Apart from being consistent with the rest of the Logstash
    documentation, this should make the asciidoc generator happier
    so it won't skip the line with the non-backticked %{fieldname}
    reference when emitting the asciidoc file.

    Fixes 41

diff --git a/lib/logstash/filters/mutate.rb b/lib/logstash/filters/mutate.rb
index 9a7857c..9ad37fa 100644
--- a/lib/logstash/filters/mutate.rb
+++ b/lib/logstash/filters/mutate.rb
@@ -33,7 +33,7 @@ class LogStash::Filters::Mutate < LogStash::Filters::Base
   # filters.
   config :remove, :validate => :array, :deprecated => true

-  # Replace a field with a new value. The new value can include %{foo} strings
+  # Replace a field with a new value. The new value can include `%{foo}` strings
   # to help you build a new value from other parts of the event.
   #
   # Example:
$ git commit --amend
[backticks 2e1a3bd] Docs: Use backtick notation for %{fieldname} references.
 Date: Sun Nov 29 21:54:27 2015 +0100
 1 file changed, 1 insertion(+), 1 deletion(-)
$ git branch
* backticks
  master
$ git push origin backticks
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 605 bytes | 0 bytes/s, done.
Total 6 (delta 2), reused 0 (delta 0)
To git@github.com:magnusbaeck/logstash-filter-mutate
 * [new branch]      backticks -> backticks
$ git fetch upstream
remote: Counting objects: 26, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 26 (delta 7), reused 2 (delta 2), pack-reused 5
Unpacking objects: 100% (26/26), done.
From https://github.com/logstash-plugins/logstash-filter-mutate
   2ca5c3c..07cbfff  master     -> upstream/master
 * [new branch]      fix/cleanup_and_speed -> upstream/fix/cleanup_and_speed
magnusbaeck commented 8 years ago

Ah, jeez. I pushed commit 07cbfff in PR #60 and had it merged last week and completely forgot about it. The commit message said "Fixed 41" (i.e. it was missing a "#") so the issue reference didn't ping the issue so it still looked unsolved when I looked. So never mind this PR then...

jordansissel commented 8 years ago

@magnusbaeck oops! Good catch :)