• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Reading log file using Java

 
Ranch Hand
Posts: 42
Android Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a requirement where I have to setup a cron job using java which will connect to a unix box and read the app server log files by SSH library, like JSch.

Basically I have to read three things from log:

1. Exception stack trace/error code (app generated) if there is any,
2. User sessionID.
3. Time Stamp.

Connecting to unix box using third party code is fine. Challenge here for me is extracting the session id and timestamp each time an exception error occur on our servers.


I know that log file is a plain text file so, java pattern and string manipulation is required here.

Could anyone give me some ways to do this

Thanks
Nazzy
 
nazzy khan
Ranch Hand
Posts: 42
Android Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I guess I have posted it in the wrong forum.

Moderators: Could you please move it to "Java in General" or in appropriate forum if required

Thanks,
Nazzy

 
Marshal
Posts: 27450
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have a big bag of miscellaneous requirements there. So when you ask how to do "this", you ask a very unclear question. What is "this"? Do you not know how to do any of those things? Or do you have questions about some of them? If so, which ones?
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you asking for how to parse a file for a particular text using java?
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic