Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just wanted to address you few things of what am looking out.
We do get CSV file from developer team as I am looking for to extract the contents of CVS file into rsyslog which internally passes on to our receiver.
2) Is there any options to convert the CSV file into log file and internally passes to our receiver.
I have read many of google documentation wherein it didnot my requirement.
What do you man by "converting" ?. Are you simply wanting to send the entire file as-is to rsyslog ?. If so see "man logger".
If you want to process the data first, only you can decide on that - maybe grep or sed or awk or perl or python or ... whatever you already know.
Hi Team,
Just wanted to address you few things of what am looking out.
We do get CSV file from developer team as I am looking for to extract the contents of CVS file into rsyslog which internally passes on to our receiver.
2) Is there any options to convert the CSV file into log file and internally passes to our receiver.
I have read many of google documentation wherein it didnot my requirement.
Oh? Which links did you read??? And as others have asked, you need to provide actual details, because we have nothing to go on, based on what you posted. Best question is WHY you need to insert a CSV file into a system log. What are you actually trying to accomplish?
Why can your 'developer' not output things in syslog format, since they are *DEVELOPERS*, and write code for a living? Have you looked at the 'logger' command? Or read the documentation on rsyslog (which you mention), and the imfile directive??
Sorry for the confusion over here from my side. As I have Signed up for the first time.
1) I have received a "csv" files from "Developer Team" in which they have extracted the files from "AS400".
Request you to find the below mentioned cvs contents.
2) The first lines contains the header.
3) The second lines contains the contents of the data. Multiple CSV file data contains 600 lines.
Requirement : -
"All these data which is inside CSV files should be parsed into /var/log/abc.log files".
Would like to know what are all the methods can be applied to parse these data?
There are THOUSANDS of ways to parse this data, and we cannot (and will not), even attempt to list them all. Again, as asked before, why can't your developers give you this data in whatever format you'd like?? And again, have you looked at the logger program, which inserts things into your system logs?? Also, we don't know what fields are important to you, how you want the data structured, etc. That's for you to decide.
Quote:
Is there any specific script can be developed to do this activity?
Yes, a script CAN be developed to do this, fairly easily.
Quote:
Just would like to inform you that am new to coding part. Can anybody help me out in this?
We will gladly help you...so post what you have written/done/tried so far, and tell us where you're stuck. You say you have a 'team' of developers...why can they not then help you DEVELOP something? There are also thousands of bash scripting tutorials, covering how to loop through files, split lines up based on delimiters, assign them to variables, and output the data in different formats. The tutorials at tldp.com are probably the best to get you started.
Read the "Question Guidelines" link...we will be glad to help, but we aren't going to write scripts for you.
By doing this manually am able to get the data in MCAfee Security tool. If I want to automate this process would like to know is there any mechanism to extract the data from csv file and storing into /var/log/abc.log?
AGAIN: Yes there is...that would be by **YOU** writing a script to pull out the data you're wanting, parsing it, and using the logger tool to insert it. AGAIN, we WILL NOT write your scripts for you.
Quote:
Originally Posted by jnagaraj82@gmail.com
Team will generate this report from AS400.
AGAIN, why can you not ask your 'developer team' to actually DEVELOP something for you? Or at the very least give you the data in a different format??
Quote:
Originally Posted by jnagaraj82@gmail.com
This report has been provided by engineering team in which they work on AS400 for audit point of view. The security team have ask them the report.
As they have provided us in CSV format. Now I need to extract these data from CSV file and put into /var/log/abc.log files.
So you have an 'engineering team', a 'security team', and a 'developer team'...yet the developers can't give you different data output, and the security team doesn't want to be involved in getting the data into the security logs, and the engineering team is ALREADY generating a report for the auditors/security?? So why can't the engineering team also provide a report to security?? And with all these 'teams', is there no one there that can write a fairly simple bash script??
Restating your wants/needs over and over isn't helpful. Again, we understand FULLY what you're trying to do, but AGAIN...we **WILL NOT** write your scripts for you. You were given advice, pointed to bash scripting tutorials, and given the name of a tool (which you're now using), to insert these things into system logs. It is now time for YOU to actually begin to do the work that you've been asked to do. Again, we are happy to help you if you're stuck, but you have yet to actually show any efforts of your own to get this done.
So:
Look at ANY of the many thousands of easily found bash scripting tutorials.
Find examples of how to read a file and loop through it until the end.
Find examples of how to split a line apart and assign those things to variables
Put those variables into a simple command-line that you **ALREADY HAVE** (the 'logger' line from above)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.