Re: Is it possible to search the console log file from slave?

39 messages Options
Embed this post
Permalink
1 2
Sami Tikka

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
What should happen when that regexp mathes? We pipe the output of our test script through "| tee log.file" and then grep the file for some known problems.  If any are found, we exit with nonzero to make the build fail.   

-- Sami

baz themail <[hidden email]> kirjoitti 4.11.2009 kello 1.21:

I know i can use the "text find plug-in", but like i said from another thread, I just cannot make it to search multiple strings :(

If I use simple expression "^Error\|FATAL", it will work for grep command but not the "text find plug-in".

Also, if you put "FATAL" in the "text find plug-in" field, it will only display one occurrence of "FATAL".

I just do not know how i can get around these problems. Please advice.

A.

On Tue, Nov 3, 2009 at 3:10 PM, baz themail <[hidden email]> wrote:
Hi,

I notice the build console log is stored in the master. Is there a way that i can, say, write my own grep command to search the console.log?

Thanks.

A.

baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Sami, thanks for your reply.

"What should happen when that regexp mathes?"

Here is a little bit more background. I am trying to grep the output files created by the platform builder. Two output files are automatically created.

I will run two grep command and here is an example: grep -e "^Error:\|FATAL" build.log. The command will return the lines that contains "^Error:" and "FATAL" keywords.

"We pipe the output of our test script through "| tee log.file" and then grep the file for some known problems.  If any are found, we exit with nonzero to make the build fail."

Understood. Typically, I will do very similar things. However, notice those log files are automatically created, so I shouldnt need to pipe it myself.

Then, why am i asking for grep'ing the actual console log file? In this particular case, for some reason, Platform builder does not pipe the particular errors into those log files, so the errors are only exists in the console log. This is the reason why i ask two questions:

1. How can i find multiple strings via text find plugin.
2. If i have to use my own grep command, how can i access the console log file itself.

A.

On Tue, Nov 3, 2009 at 9:23 PM, Sami Tikka <[hidden email]> wrote:
What should happen when that regexp mathes? We pipe the output of our test script through "| tee log.file" and then grep the file for some known problems.  If any are found, we exit with nonzero to make the build fail.   

-- Sami

baz themail <[hidden email]> kirjoitti 4.11.2009 kello 1.21:

I know i can use the "text find plug-in", but like i said from another thread, I just cannot make it to search multiple strings :(

If I use simple expression "^Error\|FATAL", it will work for grep command but not the "text find plug-in".

Also, if you put "FATAL" in the "text find plug-in" field, it will only display one occurrence of "FATAL".

I just do not know how i can get around these problems. Please advice.

A.

On Tue, Nov 3, 2009 at 3:10 PM, baz themail <[hidden email][hidden email]> wrote:
Hi,

I notice the build console log is stored in the master. Is there a way that i can, say, write my own grep command to search the console.log?

Thanks.

A.


Henk van Voorthuijsen

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink

On Nov 4, 2009, at 7:14 AM, baz themail wrote:

> Sami, thanks for your reply.
>
> "What should happen when that regexp mathes?"
>
> Here is a little bit more background. I am trying to grep the output  
> files created by the platform builder. Two output files are  
> automatically created.
>
> I will run two grep command and here is an example: grep -e "^Error:
> \|FATAL" build.log. The command will return the lines that contains  
> "^Error:" and "FATAL" keywords.

You're escaping the pipe character.  Is that what you meant to do?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Yes in the grep command. Not sure what I should put in the "text-finder plug-in" field. Please help. A.

On Wed, Nov 4, 2009 at 6:52 AM, Henk van Voorthuijsen <[hidden email]> wrote:

On Nov 4, 2009, at 7:14 AM, baz themail wrote:

Sami, thanks for your reply.

"What should happen when that regexp mathes?"

Here is a little bit more background. I am trying to grep the output files created by the platform builder. Two output files are automatically created.

I will run two grep command and here is an example: grep -e "^Error:\|FATAL" build.log. The command will return the lines that contains "^Error:" and "FATAL" keywords.

You're escaping the pipe character.  Is that what you meant to do?


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Wait, the "|" should be the same as "OR" when using grep command. Meaning, I was trying to grep strings "^Error:" or "FATAL".

On Wed, Nov 4, 2009 at 10:42 AM, baz themail <[hidden email]> wrote:
Yes in the grep command. Not sure what I should put in the "text-finder plug-in" field. Please help. A.


On Wed, Nov 4, 2009 at 6:52 AM, Henk van Voorthuijsen <[hidden email]> wrote:

On Nov 4, 2009, at 7:14 AM, baz themail wrote:

Sami, thanks for your reply.

"What should happen when that regexp mathes?"

Here is a little bit more background. I am trying to grep the output files created by the platform builder. Two output files are automatically created.

I will run two grep command and here is an example: grep -e "^Error:\|FATAL" build.log. The command will return the lines that contains "^Error:" and "FATAL" keywords.

You're escaping the pipe character.  Is that what you meant to do?


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



Sami Tikka

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
In reply to this post by baz themail
2009/11/4 baz themail <[hidden email]>:
> 1. How can i find multiple strings via text find plugin.
> 2. If i have to use my own grep command, how can i access the console log
> file itself.

I don't know

> Then, why am i asking for grep'ing the actual console log file? In this
> particular case, for some reason, Platform builder does not pipe the
> particular errors into those log files, so the errors are only exists in the
> console log.

I do not know the details of your job or build command but as far as I
know, both Unix and Windows support redirecting command output to a
file.

You probably have in your build script or build step some code that looks like:

...
"Platform builder"
...

If you can append " > platform_builder.log" to the Platform builder
call, you should be able to capture the output from Platform builder.
If you are on Unix, add " 2>&1" to it to capture also errors. Please
refer to Windows documentation on how to capture error output in batch
scripts.

After you have captured all output and errors from Platform builder to
a file, then you can grep the file.

-- Sami

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Sami, thanks.

All, I am still looking for the way to access the physical console log from slave. Anyone?

On Thu, Nov 5, 2009 at 9:42 AM, Sami Tikka <[hidden email]> wrote:
2009/11/4 baz themail <[hidden email]>:
> 1. How can i find multiple strings via text find plugin.
> 2. If i have to use my own grep command, how can i access the console log
> file itself.

I don't know

> Then, why am i asking for grep'ing the actual console log file? In this
> particular case, for some reason, Platform builder does not pipe the
> particular errors into those log files, so the errors are only exists in the
> console log.

I do not know the details of your job or build command but as far as I
know, both Unix and Windows support redirecting command output to a
file.

You probably have in your build script or build step some code that looks like:

...
"Platform builder"
...

If you can append " > platform_builder.log" to the Platform builder
call, you should be able to capture the output from Platform builder.
If you are on Unix, add " 2>&1" to it to capture also errors. Please
refer to Windows documentation on how to capture error output in batch
scripts.

After you have captured all output and errors from Platform builder to
a file, then you can grep the file.

-- Sami

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Kohsuke Kawaguchi-2

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
baz themail wrote:
> Sami, thanks.
>
> All, I am still looking for the way to access the physical console log from
> slave. Anyone?

If you are doing this from your plugin, it's very easy. FilePath handles
the remoting more or less transparently. Are you trying to do this from
your build?


>
> On Thu, Nov 5, 2009 at 9:42 AM, Sami Tikka <[hidden email]> wrote:
>
>> 2009/11/4 baz themail <[hidden email]>:
>> > 1. How can i find multiple strings via text find plugin.
>> > 2. If i have to use my own grep command, how can i access the console log
>> > file itself.
>>
>> I don't know
>>
>> > Then, why am i asking for grep'ing the actual console log file? In this
>> > particular case, for some reason, Platform builder does not pipe the
>> > particular errors into those log files, so the errors are only exists in
>> the
>> > console log.
>>
>> I do not know the details of your job or build command but as far as I
>> know, both Unix and Windows support redirecting command output to a
>> file.
>>
>> You probably have in your build script or build step some code that looks
>> like:
>>
>> ...
>> "Platform builder"
>> ...
>>
>> If you can append " > platform_builder.log" to the Platform builder
>> call, you should be able to capture the output from Platform builder.
>> If you are on Unix, add " 2>&1" to it to capture also errors. Please
>> refer to Windows documentation on how to capture error output in batch
>> scripts.
>>
>> After you have captured all output and errors from Platform builder to
>> a file, then you can grep the file.
>>
>> -- Sami
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/


smime.p7s (4K) Download Attachment
baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Yes. From the build job that runs from a Hudson slave.

Instead of using "Hudson Text Finder" plugin (so far nobody can tell me how to search multiple strings and multiple occurrence), I really would like to write a "grep -f" against the console log file (the Hudson console log output).

How can i do that? I cannot figure out a way to do it from the Hudson build job from a Hudson slave.

Please advice.

Thanks. A.

On Fri, Nov 6, 2009 at 6:05 PM, Kohsuke Kawaguchi <[hidden email]> wrote:
baz themail wrote:
> Sami, thanks.
>
> All, I am still looking for the way to access the physical console log from
> slave. Anyone?

If you are doing this from your plugin, it's very easy. FilePath handles
the remoting more or less transparently. Are you trying to do this from
your build?


>
> On Thu, Nov 5, 2009 at 9:42 AM, Sami Tikka <[hidden email]> wrote:
>
>> 2009/11/4 baz themail <[hidden email]>:
>> > 1. How can i find multiple strings via text find plugin.
>> > 2. If i have to use my own grep command, how can i access the console log
>> > file itself.
>>
>> I don't know
>>
>> > Then, why am i asking for grep'ing the actual console log file? In this
>> > particular case, for some reason, Platform builder does not pipe the
>> > particular errors into those log files, so the errors are only exists in
>> the
>> > console log.
>>
>> I do not know the details of your job or build command but as far as I
>> know, both Unix and Windows support redirecting command output to a
>> file.
>>
>> You probably have in your build script or build step some code that looks
>> like:
>>
>> ...
>> "Platform builder"
>> ...
>>
>> If you can append " > platform_builder.log" to the Platform builder
>> call, you should be able to capture the output from Platform builder.
>> If you are on Unix, add " 2>&1" to it to capture also errors. Please
>> refer to Windows documentation on how to capture error output in batch
>> scripts.
>>
>> After you have captured all output and errors from Platform builder to
>> a file, then you can grep the file.
>>
>> -- Sami
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Kohsuke?

On Fri, Nov 6, 2009 at 9:39 PM, baz themail <[hidden email]> wrote:
Yes. From the build job that runs from a Hudson slave.

Instead of using "Hudson Text Finder" plugin (so far nobody can tell me how to search multiple strings and multiple occurrence), I really would like to write a "grep -f" against the console log file (the Hudson console log output).

How can i do that? I cannot figure out a way to do it from the Hudson build job from a Hudson slave.

Please advice.

Thanks. A.


On Fri, Nov 6, 2009 at 6:05 PM, Kohsuke Kawaguchi <[hidden email]> wrote:
baz themail wrote:
> Sami, thanks.
>
> All, I am still looking for the way to access the physical console log from
> slave. Anyone?

If you are doing this from your plugin, it's very easy. FilePath handles
the remoting more or less transparently. Are you trying to do this from
your build?


>
> On Thu, Nov 5, 2009 at 9:42 AM, Sami Tikka <[hidden email]> wrote:
>
>> 2009/11/4 baz themail <[hidden email]>:
>> > 1. How can i find multiple strings via text find plugin.
>> > 2. If i have to use my own grep command, how can i access the console log
>> > file itself.
>>
>> I don't know
>>
>> > Then, why am i asking for grep'ing the actual console log file? In this
>> > particular case, for some reason, Platform builder does not pipe the
>> > particular errors into those log files, so the errors are only exists in
>> the
>> > console log.
>>
>> I do not know the details of your job or build command but as far as I
>> know, both Unix and Windows support redirecting command output to a
>> file.
>>
>> You probably have in your build script or build step some code that looks
>> like:
>>
>> ...
>> "Platform builder"
>> ...
>>
>> If you can append " > platform_builder.log" to the Platform builder
>> call, you should be able to capture the output from Platform builder.
>> If you are on Unix, add " 2>&1" to it to capture also errors. Please
>> refer to Windows documentation on how to capture error output in batch
>> scripts.
>>
>> After you have captured all output and errors from Platform builder to
>> a file, then you can grep the file.
>>
>> -- Sami
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/


Benjamin Shine-2

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

I'm just dropping in on this thread after it's been going on for almost a month... but I have to wonder if the basic approach you're taking here is the most effective one possible. 

Can you describe exactly what you're trying to accomplish, and why? What's the _underlying_ problem you're trying to solve? 

Are you willing to write a plugin, or do you need to accomplish this without writing a plugin? If so, what other tools are you willing to use? 

Feel free to ignore these questions. 

-ben


On Nov 12, 2009, at 11:51 AM, baz themail wrote:

Kohsuke?

On Fri, Nov 6, 2009 at 9:39 PM, baz themail <[hidden email]> wrote:
Yes. From the build job that runs from a Hudson slave.

Instead of using "Hudson Text Finder" plugin (so far nobody can tell me how to search multiple strings and multiple occurrence), I really would like to write a "grep -f" against the console log file (the Hudson console log output).

How can i do that? I cannot figure out a way to do it from the Hudson build job from a Hudson slave.

Please advice.

Thanks. A.


On Fri, Nov 6, 2009 at 6:05 PM, Kohsuke Kawaguchi <[hidden email]> wrote:
baz themail wrote:
> Sami, thanks.
>
> All, I am still looking for the way to access the physical console log from
> slave. Anyone?

If you are doing this from your plugin, it's very easy. FilePath handles
the remoting more or less transparently. Are you trying to do this from
your build?


>
> On Thu, Nov 5, 2009 at 9:42 AM, Sami Tikka <[hidden email]> wrote:
>
>> 2009/11/4 baz themail <[hidden email]>:
>> > 1. How can i find multiple strings via text find plugin.
>> > 2. If i have to use my own grep command, how can i access the console log
>> > file itself.
>>
>> I don't know
>>
>> > Then, why am i asking for grep'ing the actual console log file? In this
>> > particular case, for some reason, Platform builder does not pipe the
>> > particular errors into those log files, so the errors are only exists in
>> the
>> > console log.
>>
>> I do not know the details of your job or build command but as far as I
>> know, both Unix and Windows support redirecting command output to a
>> file.
>>
>> You probably have in your build script or build step some code that looks
>> like:
>>
>> ...
>> "Platform builder"
>> ...
>>
>> If you can append " > platform_builder.log" to the Platform builder
>> call, you should be able to capture the output from Platform builder.
>> If you are on Unix, add " 2>&1" to it to capture also errors. Please
>> refer to Windows documentation on how to capture error output in batch
>> scripts.
>>
>> After you have captured all output and errors from Platform builder to
>> a file, then you can grep the file.
>>
>> -- Sami
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/



baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Ben, thanks for dropping in... :)

Please see my answers below...

On Thu, Nov 12, 2009 at 12:16 PM, Benjamin Shine <[hidden email]> wrote:

I'm just dropping in on this thread after it's been going on for almost a month... but I have to wonder if the basic approach you're taking here is the most effective one possible. 

Can you describe exactly what you're trying to accomplish, and why?
My goal is simple: To search multiple strings from the Hudson console log.
 
What's the _underlying_ problem you're trying to solve? 
In theory, we should be able to use the "Hudson Text Finder" plug-in to achieve my goal. However, I am lack of regex experience and could not find the right expression to put in the field for "Hudson Text Finder" plug-in. For example, I would like to search two strings, "ERRORE" and "FATAL ERROR" from the entire console log, how can i do it? What to put in the field? (Thats why i ask for sample regex that i can put in the field and so far no answer).


Are you willing to write a plugin,
I am willing but my programming skill is very limited.
 
or do you need to accomplish this without writing a plugin?
I am actually using grep in one of the build task to grep "ERRORE" and "FATAL ERROR" and worked. However, there is no way to access the entire console log if i do that. In my particular case, (Thats why I was asking Kohsuke how i can access the physical console log in Hudson master from Hudson slave).
 
If so, what other tools are you willing to use? 
I am open as long as it make sense.

Feel free to ignore these questions. 

-ben



On Nov 12, 2009, at 11:51 AM, baz themail wrote:

Kohsuke?

On Fri, Nov 6, 2009 at 9:39 PM, baz themail <[hidden email]> wrote:
Yes. From the build job that runs from a Hudson slave.

Instead of using "Hudson Text Finder" plugin (so far nobody can tell me how to search multiple strings and multiple occurrence), I really would like to write a "grep -f" against the console log file (the Hudson console log output).

How can i do that? I cannot figure out a way to do it from the Hudson build job from a Hudson slave.

Please advice.

Thanks. A.


On Fri, Nov 6, 2009 at 6:05 PM, Kohsuke Kawaguchi <[hidden email]> wrote:
baz themail wrote:
> Sami, thanks.
>
> All, I am still looking for the way to access the physical console log from
> slave. Anyone?

If you are doing this from your plugin, it's very easy. FilePath handles
the remoting more or less transparently. Are you trying to do this from
your build?


>
> On Thu, Nov 5, 2009 at 9:42 AM, Sami Tikka <[hidden email]> wrote:
>
>> 2009/11/4 baz themail <[hidden email]>:
>> > 1. How can i find multiple strings via text find plugin.
>> > 2. If i have to use my own grep command, how can i access the console log
>> > file itself.
>>
>> I don't know
>>
>> > Then, why am i asking for grep'ing the actual console log file? In this
>> > particular case, for some reason, Platform builder does not pipe the
>> > particular errors into those log files, so the errors are only exists in
>> the
>> > console log.
>>
>> I do not know the details of your job or build command but as far as I
>> know, both Unix and Windows support redirecting command output to a
>> file.
>>
>> You probably have in your build script or build step some code that looks
>> like:
>>
>> ...
>> "Platform builder"
>> ...
>>
>> If you can append " > platform_builder.log" to the Platform builder
>> call, you should be able to capture the output from Platform builder.
>> If you are on Unix, add " 2>&1" to it to capture also errors. Please
>> refer to Windows documentation on how to capture error output in batch
>> scripts.
>>
>> After you have captured all output and errors from Platform builder to
>> a file, then you can grep the file.
>>
>> -- Sami
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/




Benjamin Shine-2

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

On Nov 12, 2009, at 3:20 PM, baz themail wrote:
On Thu, Nov 12, 2009 at 12:16 PM, Benjamin Shine <[hidden email]> wrote:

I'm just dropping in on this thread after it's been going on for almost a month... but I have to wonder if the basic approach you're taking here is the most effective one possible. 

Can you describe exactly what you're trying to accomplish, and why?
My goal is simple: To search multiple strings from the Hudson console log.

 

 
What's the _underlying_ problem you're trying to solve? 
In theory, we should be able to use the "Hudson Text Finder" plug-in to achieve my goal. However, I am lack of regex experience and could not find the right expression to put in the field for "Hudson Text Finder" plug-in. For example, I would like to search two strings, "ERRORE" and "FATAL ERROR" from the entire console log, how can i do it? What to put in the field? (Thats why i ask for sample regex that i can put in the field and so far no answer).

Okay, but why are you trying to search for strings in the Hudson console log? That sounds to me like you want to make inquiries about the build results or events during the build; that, in turn, sounds like you could be doing it by interrogating the in-memory object directly, rather than looking at the console log, which is a side effect. 


Are you willing to write a plugin,
I am willing but my programming skill is very limited.

I think you have to go for it, here. Have you gone through the quick start tutorial? The one that's actually on http://wiki.hudson-ci.org/display/HUDSON/Plugin+tutorial  not the giant one Stephen Connolly wrote. 

Then you should be able to do something like ... in the perform method of your publisher... 
theResultObject = build.getAction( ... ).getSomeInformation();

What builder are you using, btw? 

Alternately, you could do it like this, if evaluating the log is really the best thing to do:  
String logFile = Util.loadFile(run.getLogFile(), run.getCharset()); 
then use java's regex to search in that. 


 
or do you need to accomplish this without writing a plugin?
I am actually using grep in one of the build task to grep "ERRORE" and "FATAL ERROR" and worked. However, there is no way to access the entire console log if i do that. In my particular case, (Thats why I was asking Kohsuke how i can access the physical console log in Hudson master from Hudson slave).

I also suggest learning a bit about regular expressions :) Again, sorry, but you've gotta do it. Either that, or pay a college kid to build this for you :)

Hope this helps, 
ben

 
If so, what other tools are you willing to use? 
I am open as long as it make sense.

Feel free to ignore these questions. 

-ben



On Nov 12, 2009, at 11:51 AM, baz themail wrote:

Kohsuke?

On Fri, Nov 6, 2009 at 9:39 PM, baz themail <[hidden email]> wrote:
Yes. From the build job that runs from a Hudson slave.

Instead of using "Hudson Text Finder" plugin (so far nobody can tell me how to search multiple strings and multiple occurrence), I really would like to write a "grep -f" against the console log file (the Hudson console log output).

How can i do that? I cannot figure out a way to do it from the Hudson build job from a Hudson slave.

Please advice.

Thanks. A.


On Fri, Nov 6, 2009 at 6:05 PM, Kohsuke Kawaguchi <[hidden email]> wrote:
baz themail wrote:
> Sami, thanks.
>
> All, I am still looking for the way to access the physical console log from
> slave. Anyone?

If you are doing this from your plugin, it's very easy. FilePath handles
the remoting more or less transparently. Are you trying to do this from
your build?


>
> On Thu, Nov 5, 2009 at 9:42 AM, Sami Tikka <[hidden email]> wrote:
>
>> 2009/11/4 baz themail <[hidden email]>:
>> > 1. How can i find multiple strings via text find plugin.
>> > 2. If i have to use my own grep command, how can i access the console log
>> > file itself.
>>
>> I don't know
>>
>> > Then, why am i asking for grep'ing the actual console log file? In this
>> > particular case, for some reason, Platform builder does not pipe the
>> > particular errors into those log files, so the errors are only exists in
>> the
>> > console log.
>>
>> I do not know the details of your job or build command but as far as I
>> know, both Unix and Windows support redirecting command output to a
>> file.
>>
>> You probably have in your build script or build step some code that looks
>> like:
>>
>> ...
>> "Platform builder"
>> ...
>>
>> If you can append " > platform_builder.log" to the Platform builder
>> call, you should be able to capture the output from Platform builder.
>> If you are on Unix, add " 2>&1" to it to capture also errors. Please
>> refer to Windows documentation on how to capture error output in batch
>> scripts.
>>
>> After you have captured all output and errors from Platform builder to
>> a file, then you can grep the file.
>>
>> -- Sami
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/





baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
I think we are really going around a big circle now...



On Thu, Nov 12, 2009 at 3:37 PM, Benjamin Shine <[hidden email]> wrote:

On Nov 12, 2009, at 3:20 PM, baz themail wrote:
On Thu, Nov 12, 2009 at 12:16 PM, Benjamin Shine <[hidden email]> wrote:

---cut---
Can you describe exactly what you're trying to accomplish, and why?
My goal is simple: To search multiple strings from the Hudson console log.
---cut---

Okay, but why are you trying to search for strings in the Hudson console log? That sounds to me like you want to make inquiries about the build results or events during the build; that, in turn, sounds like you could be doing it by interrogating the in-memory object directly, rather than looking at the console log, which is a side effect. 
 
I am trying to search for some specific error strings. I am not trying to interrogating the in-memory object directly unless this is the only way.

What builder are you using, btw? 

I am building a product with different type of compilation. Not only using one builder plug-in such as msbuild. The error strings in question is coming from platform builder (windows CE). In theory, PB will throw out all errors into a standard file. However, I found out that some errors not appear in the standard log file. This is why i need to make use of the text find plug-in to do the same job (if it works).
 
I also suggest learning a bit about regular expressions :) Again, sorry, but you've gotta do it. Either that, or pay a college kid to build this for you :)

So far, nobody show me one single example of regular expression for find-text plug-in to do this simple task. I use the regex in command line grep successfully, but i have explained why i cannot use it in this thread. I guess i just have to give up with really making use of the text-find plug-in since "may be" nobody really use it in this group. Sorry if i seem frustrated.

lbela

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
In reply to this post by baz themail
To answer your question about which regex to use for your case.  I'm not an expert, but there is a very nice regex testing tool here: http://www.fileformat.info/tool/regex.htm that I used to get me started with regex.

It has links to java regex documentation: http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html

And there is a tutorial here: http://java.sun.com/docs/books/tutorial/essential/regex/literals.html

So, depending on the content of your lines, you may just need something like this:
.*[ERRORE|FATAL ERROR].*
baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Ibela, thanks for your reply and example.

I put

.*[ERRORE|FATAL ERROR].*

in the "Regular expression" field of "Hudson text finder and that did not work. I think i actually tried that previously after reading the documenation. Does it work for you in text finder or you are just giving me an example based on regular expression? Because if i use the regex that worked in grep, it wont work in "Hudson text finder".

On Thu, Nov 12, 2009 at 3:54 PM, lbela <[hidden email]> wrote:

To answer your question about which regex to use for your case.  I'm not an
expert, but there is a very nice regex testing tool here:
http://www.fileformat.info/tool/regex.htm that I used to get me started with
regex.

It has links to java regex documentation:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html

And there is a tutorial here:
http://java.sun.com/docs/books/tutorial/essential/regex/literals.html

So, depending on the content of your lines, you may just need something like
this:
.*[ERRORE|FATAL ERROR].*

--
View this message in context: http://n4.nabble.com/Re-Is-it-possible-to-search-the-console-log-file-from-slave-tp368890p620657.html
Sent from the Hudson users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
When i said "it doesnt work", the text finder did not return anything at all with ".*[ERRORE|FATAL ERROR].*"

On Thu, Nov 12, 2009 at 4:26 PM, baz themail <[hidden email]> wrote:
Ibela, thanks for your reply and example.

I put

.*[ERRORE|FATAL ERROR].*

in the "Regular expression" field of "Hudson text finder and that did not work. I think i actually tried that previously after reading the documenation. Does it work for you in text finder or you are just giving me an example based on regular expression? Because if i use the regex that worked in grep, it wont work in "Hudson text finder".


On Thu, Nov 12, 2009 at 3:54 PM, lbela <[hidden email]> wrote:

To answer your question about which regex to use for your case.  I'm not an
expert, but there is a very nice regex testing tool here:
http://www.fileformat.info/tool/regex.htm that I used to get me started with
regex.

It has links to java regex documentation:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html

And there is a tutorial here:
http://java.sun.com/docs/books/tutorial/essential/regex/literals.html

So, depending on the content of your lines, you may just need something like
this:
.*[ERRORE|FATAL ERROR].*

--
View this message in context: http://n4.nabble.com/Re-Is-it-possible-to-search-the-console-log-file-from-slave-tp368890p620657.html
Sent from the Hudson users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



Benjamin Shine-2

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
In reply to this post by baz themail
Some javascript/style in this post has been disabled (why?)

I think I see the disconnect here, and why you are getting frustrated at our failure to answer what seems like a simple question. The truth is that it's not a simple question. Here's why: 

1) Different flavors (implementations, standards) of regular expression packages have different (essentially) APIs. 
2) Matching a regular expression multiple times uses different mechanisms and returns results differently than just finding a single occurrence. 
3) The mechanism for requesting multiple matches varies between flavors of regular expression implementations. 
4) People who understand items 1-3 probably don't use the Text Finder plugin. 

This is the underlying reason why no one is giving you the regular expression you want: because specifying that regular expression depends on how the Text Finder plugin implements regular expressions and how/whether it exposes the mechanism to produce multiple matches. 

The other thing here is that I don't think you're asking the *right* question, but I'll save that thought for my next long compile. 

And also, just, call me crazy, but -- if you search for ERROR you will find both "ERRORE" and "FATAL ERROR". 

-ben
 
On Nov 12, 2009, at 4:26 PM, baz themail wrote:

Ibela, thanks for your reply and example.

I put

.*[ERRORE|FATAL ERROR].*

in the "Regular expression" field of "Hudson text finder and that did not work. I think i actually tried that previously after reading the documenation. Does it work for you in text finder or you are just giving me an example based on regular expression? Because if i use the regex that worked in grep, it wont work in "Hudson text finder".

On Thu, Nov 12, 2009 at 3:54 PM, lbela <[hidden email]> wrote:

To answer your question about which regex to use for your case.  I'm not an
expert, but there is a very nice regex testing tool here:
http://www.fileformat.info/tool/regex.htm that I used to get me started with
regex.

It has links to java regex documentation:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html

And there is a tutorial here:
http://java.sun.com/docs/books/tutorial/essential/regex/literals.html

So, depending on the content of your lines, you may just need something like
this:
.*[ERRORE|FATAL ERROR].*

--
View this message in context: http://n4.nabble.com/Re-Is-it-possible-to-search-the-console-log-file-from-slave-tp368890p620657.html
Sent from the Hudson users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



baz themail

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink

On Thu, Nov 12, 2009 at 7:38 PM, Benjamin Shine <[hidden email]> wrote:


4) People who understand items 1-3 probably don't use the Text Finder plugin. 

This is the underlying reason why no one is giving you the regular expression you want: because specifying that regular expression depends on how the Text Finder plugin implements regular expressions and how/whether it exposes the mechanism to produce multiple matches. 

Thats why in multiple posts and replies, i repeatedly mentioned the combination of "text finder plug-in" and "regular expression".

If people do not use "text finder plug-in", then how can they perform log analysis such as keyword search for specific errors?

And also, just, call me crazy, but -- if you search for ERROR you will find both "ERRORE" and "FATAL ERROR". 

Definitely not. In my case, there are outputs with "ERROR". But thats really not the main point of this post.


Dan Davies Brackett

Re: Is it possible to search the console log file from slave?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

 

 
 
Thats why in multiple posts and replies, i repeatedly mentioned the combination of "text finder plug-in" and "regular expression".

If people do not use "text finder plug-in", then how can they perform log analysis such as keyword search for specific errors?
 
It seems that few people find the need to do build log analysis.  You mentioned that you're interested in finding specific errors in the build log - what do those errors mean to you?  To whom are you reporting them?  Log analysis like this is a fragile thing - tools you depend on can change their text strings and all of a sudden your analysis isn't telling you what you wanted it to anymore.
1 2