Correct Grok Pattern for an optional field including spaces

If you use </> or indent text using four spaces it will appear like this

pattern_definitions => {
    "NOT_CLOSE_BRACKET" => "[^\]]*"
}

If you use three backticks on a line before and after it will appear like this

  pattern_definitions => {
    "NOT_CLOSE_BRACKET" => "[^\]]*"
  }
1 Like