Filter in grok - or _

Hello!!!

Is there a way to filter this in grok:

BMDL_DEV/4.BMDL_TEST_HELLOWORLD_DOCKER"

I am trying to break it in pieces but no luck

match => ["jenkins_jobname", "(?<jenkins_jobnameenv>.(\S*.))(?<__forwardslash>.(/+))%{NUMBER}.(?<jenkins_repo>.(\S))" ]

i would like to form the following but no luck

BMDL
_ or -
DEV
/
4
.
BMDL_TEST_HELLOWORLD_DOCKER

Thank you for the help, I really appreciate it

I cleaned it up a little. I'm not sure how you wanted the result to look like (Did you really want to extract the slash? Does the name always contain BMDL and DEV? etc. ...). But maybe this can help.

(?<jenkins_jobnameenv>\S*[-_]\S*)/+%{NUMBER}\.(?<jenkins_repo>\S*)

{
  "jenkins_jobnameenv": [
    [
      "BMDL_DEV"
    ]
  ],
  "NUMBER": [
    [
      "4"
    ]
  ],
  "BASE10NUM": [
    [
      "4"
    ]
  ],
  "jenkins_repo": [
    [
      "BMDL_TEST_HELLOWORLD_DOCKER"
    ]
  ]
}
1 Like

thank you!! :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.