Re: Getting error while using BUILD_LOG_REGEX in emailext

2023-06-23 Thread Jyoti singhal
Ok Thank you so much for your help
This is finally working.
\${BUILD_LOG_REGEX, regex="^.*Check out job at",
showTruncatedLines="false",substText=" Access the test recording here: "}
Resolution: I have just changed regex and made it check from the start of
the line and replace it by using subsText . Its working perfectly now.




On Fri, Jun 23, 2023 at 11:06 PM Alex Earl  wrote:

> I believe you can use $ as the substText parameter, e.g. have a
> capturing part of your regex and $1 would be the first capture group, $2
> would be the second capture group, etc.
>
> On Fri, Jun 23, 2023 at 10:09 AM Jyoti singhal 
> wrote:
>
>> Hi Alex,
>>
>> Apologies from my side. Its working with single quotes now, I was giving
>> the wrong syntax,
>>
>> Wanted to check one thing right now it's extracting this whole line, Is
>> there any way to just get this link in email?
>> [image: image.png]
>>
>> On Fri, Jun 23, 2023 at 9:38 PM Alex Earl  wrote:
>>
>>> Can you share your single quote version? I just want to make sure you
>>> are doing what I expect.
>>>
>>> On Fri, Jun 23, 2023 at 7:16 AM Jyoti singhal 
>>> wrote:
>>>
 i have tried with Single quotes as well , it takes it as a text and
 print the complete line as it is.

 Thanks,
 Jyoti

 On Fri, 23 Jun, 2023, 18:16 Alex Earl,  wrote:

> When you use double quotes in pipeline, the groovy engine will try and
> interpolate the variables it sees. You should try using single quotes
> around the body value.
>
> On Fri, Jun 23, 2023, 04:13 Jyoti singhal  wrote:
>
>> Hi All,
>>
>> I am trying to get one line from build logs and sending in email for
>> that i tied to use BUILD_LOG_REGEX in emailext but its throwing me this
>> error
>>
>> *CodCode:*
>> *```*
>> { emailext (
>> mimeType: 'text/html',
>> attachLog: true,
>> subject: "Jenkins Build ${currentBuild.currentResult}: Job ${
>> env.JOB_NAME}",
>> body: "${BUILD_LOG_REGEX, regex="Check out job at", maxMatches=2,
>> showTruncatedLines=false}",
>> to: 'jyoti2xx'
>> *```*
>> *Error:*
>> 6:10:26
>>  org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
>> failed:
>> 16:10:26  WorkflowScript: 38: unexpected token: BUILD_LOG_REGEX @
>> line 38, column 15.
>> 16:10:26  body: "${BUILD_LOG_REGEX, regex="Check out job at",
>> maxMatches=2, showTruncatedLines=false}",
>> 16:10:26
>>
>>
>> Any idea how to fix this issue?
>>
>> Thanks,
>> Jyoti
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/b64d7b8d-1595-40bd-8096-f88da3e2e81cn%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVefUjn8GLFfaY%3DBmzyd428bbT08e2R5i%3D1e5_TdRq3A0g%40mail.gmail.com
> 
> .
>
 --
 You received this message because you are subscribed to the Google
 Groups "Jenkins Users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to jenkinsci-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/jenkinsci-users/CA%2BC7GVyxERm9u9qO0703457Gpj97NfuTbGQZgz3078rx%3Dbs43g%40mail.gmail.com
 
 .

>>>
>>>
>>> --
>>> Website: http://earl-of-code.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVeOAVMr8QnY-%2B-H2Bp7uivy0FYmiBcCZGWctnLwYk1ofw%40mail.gmail.com
>>> 

Re: Getting error while using BUILD_LOG_REGEX in emailext

2023-06-23 Thread Alex Earl
I believe you can use $ as the substText parameter, e.g. have a
capturing part of your regex and $1 would be the first capture group, $2
would be the second capture group, etc.

On Fri, Jun 23, 2023 at 10:09 AM Jyoti singhal  wrote:

> Hi Alex,
>
> Apologies from my side. Its working with single quotes now, I was giving
> the wrong syntax,
>
> Wanted to check one thing right now it's extracting this whole line, Is
> there any way to just get this link in email?
> [image: image.png]
>
> On Fri, Jun 23, 2023 at 9:38 PM Alex Earl  wrote:
>
>> Can you share your single quote version? I just want to make sure you are
>> doing what I expect.
>>
>> On Fri, Jun 23, 2023 at 7:16 AM Jyoti singhal 
>> wrote:
>>
>>> i have tried with Single quotes as well , it takes it as a text and
>>> print the complete line as it is.
>>>
>>> Thanks,
>>> Jyoti
>>>
>>> On Fri, 23 Jun, 2023, 18:16 Alex Earl,  wrote:
>>>
 When you use double quotes in pipeline, the groovy engine will try and
 interpolate the variables it sees. You should try using single quotes
 around the body value.

 On Fri, Jun 23, 2023, 04:13 Jyoti singhal  wrote:

> Hi All,
>
> I am trying to get one line from build logs and sending in email for
> that i tied to use BUILD_LOG_REGEX in emailext but its throwing me this
> error
>
> *CodCode:*
> *```*
> { emailext (
> mimeType: 'text/html',
> attachLog: true,
> subject: "Jenkins Build ${currentBuild.currentResult}: Job ${
> env.JOB_NAME}",
> body: "${BUILD_LOG_REGEX, regex="Check out job at", maxMatches=2,
> showTruncatedLines=false}",
> to: 'jyoti2xx'
> *```*
> *Error:*
> 6:10:26
>  org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> failed:
> 16:10:26  WorkflowScript: 38: unexpected token: BUILD_LOG_REGEX @ line
> 38, column 15.
> 16:10:26  body: "${BUILD_LOG_REGEX, regex="Check out job at",
> maxMatches=2, showTruncatedLines=false}",
> 16:10:26
>
>
> Any idea how to fix this issue?
>
> Thanks,
> Jyoti
>
> --
> You received this message because you are subscribed to the Google
> Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/b64d7b8d-1595-40bd-8096-f88da3e2e81cn%40googlegroups.com
> 
> .
>
 --
 You received this message because you are subscribed to the Google
 Groups "Jenkins Users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to jenkinsci-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVefUjn8GLFfaY%3DBmzyd428bbT08e2R5i%3D1e5_TdRq3A0g%40mail.gmail.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/CA%2BC7GVyxERm9u9qO0703457Gpj97NfuTbGQZgz3078rx%3Dbs43g%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> Website: http://earl-of-code.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVeOAVMr8QnY-%2B-H2Bp7uivy0FYmiBcCZGWctnLwYk1ofw%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CA%2BC7GVwazONoa2YQ5C-x%2BzadEChK9Qz4O%2BsUH7C7r9dyoOa7_g%40mail.gmail.com
> 

Re: Getting error while using BUILD_LOG_REGEX in emailext

2023-06-23 Thread Jyoti singhal
Hi Alex,

Apologies from my side. Its working with single quotes now, I was giving
the wrong syntax,

Wanted to check one thing right now it's extracting this whole line, Is
there any way to just get this link in email?
[image: image.png]

On Fri, Jun 23, 2023 at 9:38 PM Alex Earl  wrote:

> Can you share your single quote version? I just want to make sure you are
> doing what I expect.
>
> On Fri, Jun 23, 2023 at 7:16 AM Jyoti singhal  wrote:
>
>> i have tried with Single quotes as well , it takes it as a text and print
>> the complete line as it is.
>>
>> Thanks,
>> Jyoti
>>
>> On Fri, 23 Jun, 2023, 18:16 Alex Earl,  wrote:
>>
>>> When you use double quotes in pipeline, the groovy engine will try and
>>> interpolate the variables it sees. You should try using single quotes
>>> around the body value.
>>>
>>> On Fri, Jun 23, 2023, 04:13 Jyoti singhal  wrote:
>>>
 Hi All,

 I am trying to get one line from build logs and sending in email for
 that i tied to use BUILD_LOG_REGEX in emailext but its throwing me this
 error

 *CodCode:*
 *```*
 { emailext (
 mimeType: 'text/html',
 attachLog: true,
 subject: "Jenkins Build ${currentBuild.currentResult}: Job ${
 env.JOB_NAME}",
 body: "${BUILD_LOG_REGEX, regex="Check out job at", maxMatches=2,
 showTruncatedLines=false}",
 to: 'jyoti2xx'
 *```*
 *Error:*
 6:10:26
  org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
 failed:
 16:10:26  WorkflowScript: 38: unexpected token: BUILD_LOG_REGEX @ line
 38, column 15.
 16:10:26  body: "${BUILD_LOG_REGEX, regex="Check out job at",
 maxMatches=2, showTruncatedLines=false}",
 16:10:26


 Any idea how to fix this issue?

 Thanks,
 Jyoti

 --
 You received this message because you are subscribed to the Google
 Groups "Jenkins Users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to jenkinsci-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/jenkinsci-users/b64d7b8d-1595-40bd-8096-f88da3e2e81cn%40googlegroups.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVefUjn8GLFfaY%3DBmzyd428bbT08e2R5i%3D1e5_TdRq3A0g%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/CA%2BC7GVyxERm9u9qO0703457Gpj97NfuTbGQZgz3078rx%3Dbs43g%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Website: http://earl-of-code.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVeOAVMr8QnY-%2B-H2Bp7uivy0FYmiBcCZGWctnLwYk1ofw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CA%2BC7GVwazONoa2YQ5C-x%2BzadEChK9Qz4O%2BsUH7C7r9dyoOa7_g%40mail.gmail.com.


Re: Getting error while using BUILD_LOG_REGEX in emailext

2023-06-23 Thread Alex Earl
Can you share your single quote version? I just want to make sure you are
doing what I expect.

On Fri, Jun 23, 2023 at 7:16 AM Jyoti singhal  wrote:

> i have tried with Single quotes as well , it takes it as a text and print
> the complete line as it is.
>
> Thanks,
> Jyoti
>
> On Fri, 23 Jun, 2023, 18:16 Alex Earl,  wrote:
>
>> When you use double quotes in pipeline, the groovy engine will try and
>> interpolate the variables it sees. You should try using single quotes
>> around the body value.
>>
>> On Fri, Jun 23, 2023, 04:13 Jyoti singhal  wrote:
>>
>>> Hi All,
>>>
>>> I am trying to get one line from build logs and sending in email for
>>> that i tied to use BUILD_LOG_REGEX in emailext but its throwing me this
>>> error
>>>
>>> *CodCode:*
>>> *```*
>>> { emailext (
>>> mimeType: 'text/html',
>>> attachLog: true,
>>> subject: "Jenkins Build ${currentBuild.currentResult}: Job ${
>>> env.JOB_NAME}",
>>> body: "${BUILD_LOG_REGEX, regex="Check out job at", maxMatches=2,
>>> showTruncatedLines=false}",
>>> to: 'jyoti2xx'
>>> *```*
>>> *Error:*
>>> 6:10:26  org.codehaus.groovy.control.MultipleCompilationErrorsException:
>>> startup failed:
>>> 16:10:26  WorkflowScript: 38: unexpected token: BUILD_LOG_REGEX @ line
>>> 38, column 15.
>>> 16:10:26  body: "${BUILD_LOG_REGEX, regex="Check out job at",
>>> maxMatches=2, showTruncatedLines=false}",
>>> 16:10:26
>>>
>>>
>>> Any idea how to fix this issue?
>>>
>>> Thanks,
>>> Jyoti
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/b64d7b8d-1595-40bd-8096-f88da3e2e81cn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVefUjn8GLFfaY%3DBmzyd428bbT08e2R5i%3D1e5_TdRq3A0g%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CA%2BC7GVyxERm9u9qO0703457Gpj97NfuTbGQZgz3078rx%3Dbs43g%40mail.gmail.com
> 
> .
>


-- 
Website: http://earl-of-code.com

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVeOAVMr8QnY-%2B-H2Bp7uivy0FYmiBcCZGWctnLwYk1ofw%40mail.gmail.com.


Re: Getting error while using BUILD_LOG_REGEX in emailext

2023-06-23 Thread Jyoti singhal
i have tried with Single quotes as well , it takes it as a text and print
the complete line as it is.

Thanks,
Jyoti

On Fri, 23 Jun, 2023, 18:16 Alex Earl,  wrote:

> When you use double quotes in pipeline, the groovy engine will try and
> interpolate the variables it sees. You should try using single quotes
> around the body value.
>
> On Fri, Jun 23, 2023, 04:13 Jyoti singhal  wrote:
>
>> Hi All,
>>
>> I am trying to get one line from build logs and sending in email for that
>> i tied to use BUILD_LOG_REGEX in emailext but its throwing me this error
>>
>> *CodCode:*
>> *```*
>> { emailext (
>> mimeType: 'text/html',
>> attachLog: true,
>> subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME
>> }",
>> body: "${BUILD_LOG_REGEX, regex="Check out job at", maxMatches=2,
>> showTruncatedLines=false}",
>> to: 'jyoti2xx'
>> *```*
>> *Error:*
>> 6:10:26  org.codehaus.groovy.control.MultipleCompilationErrorsException:
>> startup failed:
>> 16:10:26  WorkflowScript: 38: unexpected token: BUILD_LOG_REGEX @ line
>> 38, column 15.
>> 16:10:26  body: "${BUILD_LOG_REGEX, regex="Check out job at",
>> maxMatches=2, showTruncatedLines=false}",
>> 16:10:26
>>
>>
>> Any idea how to fix this issue?
>>
>> Thanks,
>> Jyoti
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/b64d7b8d-1595-40bd-8096-f88da3e2e81cn%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVefUjn8GLFfaY%3DBmzyd428bbT08e2R5i%3D1e5_TdRq3A0g%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CA%2BC7GVyxERm9u9qO0703457Gpj97NfuTbGQZgz3078rx%3Dbs43g%40mail.gmail.com.


Re: Getting error while using BUILD_LOG_REGEX in emailext

2023-06-23 Thread Alex Earl
When you use double quotes in pipeline, the groovy engine will try and
interpolate the variables it sees. You should try using single quotes
around the body value.

On Fri, Jun 23, 2023, 04:13 Jyoti singhal  wrote:

> Hi All,
>
> I am trying to get one line from build logs and sending in email for that
> i tied to use BUILD_LOG_REGEX in emailext but its throwing me this error
>
> *CodCode:*
> *```*
> { emailext (
> mimeType: 'text/html',
> attachLog: true,
> subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}
> ",
> body: "${BUILD_LOG_REGEX, regex="Check out job at", maxMatches=2,
> showTruncatedLines=false}",
> to: 'jyoti2xx'
> *```*
> *Error:*
> 6:10:26  org.codehaus.groovy.control.MultipleCompilationErrorsException:
> startup failed:
> 16:10:26  WorkflowScript: 38: unexpected token: BUILD_LOG_REGEX @ line 38,
> column 15.
> 16:10:26  body: "${BUILD_LOG_REGEX, regex="Check out job at",
> maxMatches=2, showTruncatedLines=false}",
> 16:10:26
>
>
> Any idea how to fix this issue?
>
> Thanks,
> Jyoti
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/b64d7b8d-1595-40bd-8096-f88da3e2e81cn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVefUjn8GLFfaY%3DBmzyd428bbT08e2R5i%3D1e5_TdRq3A0g%40mail.gmail.com.


Getting error while using BUILD_LOG_REGEX in emailext

2023-06-23 Thread Jyoti singhal
Hi All,

I am trying to get one line from build logs and sending in email for that i 
tied to use BUILD_LOG_REGEX in emailext but its throwing me this error

*CodCode:*
*```*
{ emailext (
mimeType: 'text/html',
attachLog: true,
subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}",
body: "${BUILD_LOG_REGEX, regex="Check out job at", maxMatches=2, 
showTruncatedLines=false}",
to: 'jyoti2xx'
*```*
*Error:*
6:10:26  org.codehaus.groovy.control.MultipleCompilationErrorsException: 
startup failed:
16:10:26  WorkflowScript: 38: unexpected token: BUILD_LOG_REGEX @ line 38, 
column 15.
16:10:26  body: "${BUILD_LOG_REGEX, regex="Check out job at", 
maxMatches=2, showTruncatedLines=false}",
16:10:26   


Any idea how to fix this issue?

Thanks,
Jyoti

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b64d7b8d-1595-40bd-8096-f88da3e2e81cn%40googlegroups.com.