bash script to find/grep particular string in xml files in particular folders

Posted by user3702188 on Stack Overflow See other posts from Stack Overflow or by user3702188
Published on 2014-06-03T10:04:52Z Indexed on 2014/06/03 21:25 UTC
Read the original article Hit count: 176

Filed under:
|
|
|

i have a problem at work, where i need to simplify the process how i searrh for logs. I would like to ask for help from experts here.

We have different services for every channel. The structure is following:

- root/channel_1/service_1/2014-05-21/file_54544654541.xml 
- root/channel_1/server2_2/2014-05-20/file_74272172.xml
- root/channel_1/service_3/2014-05-22/file_45456546.xml
- root/channel_2/service_4/2014-05-23/file_78754456.xml
- root/channel_2/service_5/2014-05-24/file_546546546.xml

my main problem is to find particular string in these xml files. Lets say, i know the channel name but i dont know the service name under which my particular string should be present. Also i know the date.

So in search i want to enter the channel name the date and string. The search would be going via all service folders and looking for string only in all xml files under particular date folder and particular channel.

any ideas for quickest and easiest solution to achieve this? Either by bash or perl?

Any help would be appreciated

thanks

© Stack Overflow or respective owner

Related posts about Xml

Related posts about perl