ALERT! The community will be read-only on April 19, 8am Pacific as the migration begins. Read more for important details.
ALERT! The community will be read-only on April 19, 8am Pacific as the migration begins.Read more for important details.
Captain Captain
Captain
880 views

Problem parsing a file with delimiter

Hi,

I have been trying to parse a file with fixed format logs. Fields are separated by "|" .

So, I have used "|" as delimiter.  But the logs are not getting parsed. When checked the agent.log it shows a warning message

"Found less tokens than expected [1<86] for input [............]" . I don't know why it is taking the entire log line as single token. And one more thing is the first token in the log line - timestamp -  is getting parsed and the rest tokens are getting dropped

Also attaching the error screenshot here.

Any help on this please.

0 Likes
5 Replies
Vice Admiral
Vice Admiral

how is the separator line in the parser?

0 Likes
Captain Captain
Captain

Hi,

I wrote it like

"delimiter=\\| "

Please find the scrrenshot of the same.

Regards,

Sumanth M

0 Likes
Vice Admiral
Vice Admiral

It is not visible but do you have spaces between the "|"?

0 Likes
Captain Captain
Captain

No, there are no spaces around "|"

The sample log looks like this :

|77109|||60849||||||||||||||||||||||||316112087|No|

A total of 86 tokens are present in a log line.

0 Likes
Captain Captain
Captain

Hi,

Any help on this please !!!!

Regards,

Sumanth

0 Likes
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.