Sponsored Content
Top Forums Shell Programming and Scripting Outputting data from log file to report Post 303029387 by ae4ml on Friday 25th of January 2019 03:28:46 PM
Old 01-25-2019
Outputting data from log file to report

I have a log file that looks like this. the lines are grouped. 2 lines per entry.

Code:
M: 2019-01-25 13:02:31.698 P25, received network transmission from KI4EKI to TG 10282
M: 2019-01-25 13:02:35.694 P25, network end of transmission, 4.3 seconds, 1% packet loss
M: 2019-01-25 13:02:38.893 P25, received network transmission from AE4ML to TG 10282
M: 2019-01-25 13:02:39.595 P25, network end of transmission, 0.9 seconds, 0% packet loss
M: 2019-01-25 13:02:42.747 P25, received network transmission from KI4EKI to TG 10282
M: 2019-01-25 13:02:52.123 P25, network end of transmission, 9.7 seconds, 0% packet loss
M: 2019-01-25 13:03:00.388 P25, received network transmission from AE4ML to TG 10282
M: 2019-01-25 13:03:03.426 P25, network end of transmission, 3.2 seconds, 0% packet loss



I'm trying to pull data into one line , initial date, time and mode (P25) , past "transmission from" , To TG ", " end of transmission" and packet loss.

I have tried to grab everything from "Transmission from" to "loss"

using awk I can only pull what I want from the first line.

Code:
awk ' /transmission\ from/,/loss/ {for (I=1;I<=NF;I++) if ($I == "from") {print " CALL: "$(I+1) " TalkGroup "$(I+4)};} ' MMDVM.log




Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 01-25-2019 at 04:39 PM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem getting data to a report file.

Hi all, I'm trying in vain to workout how I can generate a report from a months worth of files that get created every day. There is one file per day and each daily file contain the output from a df -v command. With the following section of code ... for xdffile in $1$2/df?? do ... (4 Replies)
Discussion started by: Cameron
4 Replies

2. Shell Programming and Scripting

Help in outputting the result in log files

This is the file am having: "40","1G1AL55 ",30482,9000 "40","1G1ZT58 ",29098,10600 "40","1G1AL15 ",29222,9400 "46","1G6KD57 ",3083,28400 "46","1G6KD57 ",27909,25200 "49","1G1ZU57 ",16391,13900 "49","1G2ZG58 ",28856,12400 I want to display the output in three files... (23 Replies)
Discussion started by: dave_nithis
23 Replies

3. Shell Programming and Scripting

Outputting formatted Result log file from old 30000 lines result log<help required>

Well I have a 3000 lines result log file that contains all the machine data when it does the testing... It has 3 different section that i am intrsted in 1) starting with "20071126 11:11:11 Machine Header 1" 1000 lines... "End machine header 1" 2) starting with "20071126 12:12:12 Machine... (5 Replies)
Discussion started by: vikas.iet
5 Replies

4. UNIX for Dummies Questions & Answers

create data file from report file

Dear Ones, kindly help me to create a data file from the report file as shown here under( i am new one to unix KNOW BASIC COMMANDS) file:rama.prt (ist record)(3 to 4 lines of text with different filed names) Name :M.LALITHA DOB:12/11/45 DESG :JA(P) STANO:300175 ... (3 Replies)
Discussion started by: cvvsnm
3 Replies

5. Shell Programming and Scripting

outputting data in table from grep results

Hi all. I'm a real unix newbie and looking for some help on a shell scripting problem. I'm going the longest ways around everything but I'm getting there. My next problem however has me stumped. I have set up a program that takes inputs from a user for a particular month and year (and stores them... (2 Replies)
Discussion started by: Chillspark
2 Replies

6. Shell Programming and Scripting

Outputting data from multiple lines

Hi guys, looking for a bit of advise, and as I am a complete novice, please excuse the daft questions!! I have a list of events and of which entry looks like this; # # Event 1 # NAME = Event 1 # 12345 : 123 : 1 : 1 : L,1,N : 1,0 : Event # # Event 2 # NAME = Event 2 # 12346... (8 Replies)
Discussion started by: JayC89
8 Replies

7. Red Hat

Outputting clive --debug to file?

I am running clive on Linux version 2.6.24.5-85.fc8 (Red Hat 4.1.2-33) with the debug command as follows clive --debug -O <logfile> http://www.youtube.com/watch?v.... I need to get the contents of the debug written to file to extract data later. Using the -O option actually writes the... (0 Replies)
Discussion started by: rob171171
0 Replies

8. UNIX for Dummies Questions & Answers

outputting set -x to file

I need to enable set -x in my croned script as at times the script is not returning all data that it should be. This only happens intermittently and as such I would like a means of being able to check what goes wrong. My question is how to output the debug of set -x to file? (1 Reply)
Discussion started by: rob171171
1 Replies

9. Shell Programming and Scripting

Create a report for client with a text data file

Hi, I am an amateur bash scriptwriter and I need to write a script which creates a report in a formatted, easy to read table-like that is displayed to standard output. The script has to export the followings: Process ID,User Name, Command Name,Priority..... Now I have a file that I can see all... (3 Replies)
Discussion started by: bashily
3 Replies

10. Shell Programming and Scripting

Outputting Errors to a Log file

Good Morning, Every so often, I have copy scripts that to don't complete, but I don't immediately know why. It usually ends up being a permissions issue or a length issue. The scripts edit a log file, so I'd like to include any copy errors/issues in that file to check if the copies... (4 Replies)
Discussion started by: Stellaman1977
4 Replies
transmission-remote-cli(1)				      transmission-remote-cli					transmission-remote-cli(1)

NAME
transmission-remote-cli - a console client for the Transmission BitTorrent client SYNOPSIS
transmission-remote-cli [options] [filename-or-URL] DESCRIPTION
transmission-remote-cli is a curses interface for the daemon of the BitTorrent client Transmission. OPTIONS
--version Show version number and exit -h --help Show usage information and a list of options -c CONNECTION --connect=CONNECTION Point to the server. CONNECTION must match the following pattern: [username:password@]host[:port][path] Default: localhost:9091 -s --ssl Use SSL to connect to the server. Default: don't use SSL --create-config Create configuration file with default values. NOTE: A config file won't be created unless you provide this option at least once. After that, it is rewritten whenever transmis- sion-remote-cli exits. -f CONFIGFILE --config=CONFIGFILE Set path to configuration file. Default: ~/.config/transmission-remote-cli/settings.cfg -n --netrc Get authentication info from ~/.netrc. -- OPTIONS Use the known server connection to pass OPTIONS on to transmission-remote. FILES
transmission-remote-cli overwrites the configuration file on exit. Keep that in mind if you edit it manually. SEE ALSO
transmission-create(1), transmission-daemon(1), transmission-edit(1), transmission-gtk(1), transmission-qt(1), transmission-remote(1), transmission-show(1). April 22, 2012 transmission-remote-cli(1)
All times are GMT -4. The time now is 07:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy