10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I would like to seek your help for a script that will extract data from log file and put it in a file.
Sample log file
2018-10-23 12:33:21 AI ERROR -- tpid: SAMPLE_TH account: 123456789 aiSessionNumber: 660640464 mapName: xxx to yyy
errorDesc: Translation Error:ErrorNumber : 993 ... (2 Replies)
Discussion started by: neverwinter112
2 Replies
2. UNIX for Beginners Questions & Answers
Hi All,
I have a requirement to get the address values from a large log file along with the user details.
line1,line2,city,stateCode,postalCode,countryCode. The below code as advised in the earlier post is giving the user data
zgrep -B1 "Failed to calculate Tax" log.2018-05-23.gz | grep... (8 Replies)
Discussion started by: nextStep
8 Replies
3. Shell Programming and Scripting
Hi
I have an inherited perl script that extracts the first three octets of an IP Address using a combination of split() against a dot and then builds it all back together again, its a whole block of code to do this
I wondered if anyone had a one liner in their arsenal to extract the first... (7 Replies)
Discussion started by: hcclnoodles
7 Replies
4. Shell Programming and Scripting
Hi,
I have a log file (log.txt) that which contains lines of date/time.
I need to create a script to extract a CSV file (out.csv) that gets all the sequential times (with only 1 minute difference) together by stating the start time and end time of this period.
Sample log file (log.txt)
... (7 Replies)
Discussion started by: Mr.Zizo
7 Replies
5. Shell Programming and Scripting
Hi All,
Would anyone know how to modify the below, so only the IPv6 address (red) is printed, please?
(in other words, what's between inet6 and the / sign)
ipv6=`/sbin/ifconfig lo0:5 inet6 | grep 'inet6'`
print $ipv6
Currently the output of the above script is:
inet6... (7 Replies)
Discussion started by: chatguy
7 Replies
6. Shell Programming and Scripting
Hi Folks,
In my program, I have a variable which consists of multiple lines. i need to use each line as an input. My intention is to extract the email address of the user in each line and use it to process further.
The email address could be anywhere in the whole line. But there will be only... (5 Replies)
Discussion started by: ragz_82
5 Replies
7. Shell Programming and Scripting
Hi all ,
I have a string in my weblog xheader v6-day-2011:xx:yy:zz:qq:qq:ww:ee:rr
My requirement is to lookup the sting v6-day-2011 in this header and if found would like to extract the V6 ip part .
v6-day-2011 is always constant for a ipv6 entry so i would like to extract every thing... (4 Replies)
Discussion started by: jambesh
4 Replies
8. Shell Programming and Scripting
Hi i new to scripting and am trying to create a script to pull my current of logs from /var/logs/secure and name it securelog-Month-Day-Hour.txt
example:
grep 'Mar 5 11' /var/logs/secure > /home/(user)/Documents/Logs/mylog-02-1-11
How do i set the targeted strings to be the current... (2 Replies)
Discussion started by: M47H415
2 Replies
9. Shell Programming and Scripting
Hello All,
I just need to extract the date portion from a apache log file
I am able to do it using the chain of command -
Logfile contents - First record -
==========================
197.130.211.240 - - "GET /jp/index.shtml HTTP/1.1" 200 24255... (4 Replies)
Discussion started by: jambesh
4 Replies
10. Shell Programming and Scripting
I know this should be simple but the periods in the string replacement are throwing me off.
What I want to do is replace 1.1.1.1 in my access.log file with 2.2.2.2
I have tried using 'tr' but its being thrown off by the periods and replacing all sorts of stuff in the file.
What do I need... (2 Replies)
Discussion started by: LordJezo
2 Replies