make a filter to take only last N lines
i've been trying to make a filter on stdOut (a result log from a script) that is too long to see from central, you see the " Truncated... "
I tried RegExp, scripting but i cant' make it to work.
The only rexexp i've found is written in php and can't translate to java.
Has anyone ever tried something like that?
I would like to filter last 20 lines for example, because the error is always on the last lines.
Thank You All.
Re: make a filter to take only last N lines
According to me, you have to proceed as follows:
1- Using the new line character, you split your input in a scriptlet (you get an array).
2- You get the length of that array,
3- you can select any set of lines that you want (a line is an element of the array).