Building two series from one dataset in gnuplot

I have the following data file:

Time;Server;Hits
2011.05.05 12:00:01;Server1;12
2011.05.05 12:00:01;Server2;10
2011.05.05 12:00:02;Server1;2
2011.05.05 12:00:02;Server2;4

So far I came with the following gnuplot script:

set datafile separator ";"
set autoscale
set xdata time
set timefmt "%Y.%m.%d %H:%M:%S"
set xtics rotate 
set term png 
set output "hits.png"
set style fill solid 0.5
plot "hits.log" using 1:3 title 'Hits'

But this graph displays data from both servers on the same graph as one series of data. How to make gnuplot display 2 series of data: one for each server?

+3
source share
1 answer

I myself found the soloton:

plot "hits.log" using 1:(stringcolumn(2) eq "Server1" ? $3 : 1/0) title 'Server1' with lines,\
     "hits.log" using 1:(stringcolumn(2) eq "Server2" ? $3 : 1/0) title 'Server2' with lines
+5
source

All Articles