New Member.

make a filter to take only last N lines

Hello all,

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.


Tags (1)
2 Replies
New Member.

Re: make a filter to take only last N lines


Could you please provide sample data so that we can try something ?

I believe it should be fairly easy using scriptlet 


Adel_HPOO_1020 Super Contributor.
Super Contributor.

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).


The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.