Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a logfile with the following data in it:

Sat Sep 20 11:25:01 BST 2014 -- temp=53.0'C -- message from script /usr/src/scripts/wifi_test_2.sh
Sat Sep 20 11:26:01 BST 2014 -- temp=53.0'C -- message from script /usr/src/scripts/wifi_test_2.sh
Sat Sep 20 11:27:01 BST 2014 -- temp=53.0'C -- message from script /usr/src/scripts/wifi_test_2.sh

There are many more logs but I've shown only 3.

I have a script with the following commands in it, but the data is not in the correct format for GNUplot to work.

SCRIPT:

set terminal png size 400,300
set output '/usr/src/scripts/plots/core_temp_data/output.png'
plot "/var/log/rebootlogfile.log" using 4:8 with lines

Is it possible to plot 11:25:01 against 53.0 with a gnu command,or gnu and awk, or do I have to strip out the log file of unnecessary data?

share|improve this question
    
I don't use gnuplot but the error seems pretty clear: plot: command not found. Are you sure the command you're looking for is plot? –  terdon Sep 23 '14 at 12:59
    
What? That's a completely different error. –  terdon Sep 23 '14 at 13:22
    
You can see how to plot time data in gnuplot here: gnuplot.sourceforge.net/demo/timedat.html. You can also see how to parse the timestamp and convert it to the format that gnuplot accepts here: gnu.org/software/gawk/manual/html_node/Time-Functions.html. You can also use an awk script in gnuplot using this syntax: plot "<awk '{commands;}' file" using ... Placing them all together is just coding. –  user000001 Sep 23 '14 at 18:08
    
I like the first example in the first link, but to understand it I need the raw data, and how it's presented in the file timedat.dat. Do you know where I can get this from? Also the last example is interesting, but I need a few working "commands" examples to see how they work. I'm looking for "awk commands" that manipulate "text=number" and plot just the number when it recognizes "text=" –  reggie Sep 23 '14 at 21:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.