<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=HoneyPot%3A_Dionaea_Visualisasi_Data</id>
	<title>HoneyPot: Dionaea Visualisasi Data - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=HoneyPot%3A_Dionaea_Visualisasi_Data"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=HoneyPot:_Dionaea_Visualisasi_Data&amp;action=history"/>
	<updated>2026-04-20T11:04:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=HoneyPot:_Dionaea_Visualisasi_Data&amp;diff=36631&amp;oldid=prev</id>
		<title>Onnowpurbo: New page: data visualisation  new files Presenting data in a human compatible way is a problem, rumors say at this stage of evolution pictures work best. Therefore some hints how to create graphs us...</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=HoneyPot:_Dionaea_Visualisasi_Data&amp;diff=36631&amp;oldid=prev"/>
		<updated>2013-04-13T22:04:08Z</updated>

		<summary type="html">&lt;p&gt;New page: data visualisation  new files Presenting data in a human compatible way is a problem, rumors say at this stage of evolution pictures work best. Therefore some hints how to create graphs us...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;data visualisation&lt;br /&gt;
&lt;br /&gt;
new files&lt;br /&gt;
Presenting data in a human compatible way is a problem, rumors say at this stage of evolution pictures work best.&lt;br /&gt;
Therefore some hints how to create graphs using the dionaea logsql sqlite database.&lt;br /&gt;
sqlite&lt;br /&gt;
&lt;br /&gt;
As dionaea embeds sqlite, it is rather easy to extract the data.&lt;br /&gt;
the &amp;#039;uniq files&amp;#039; query&lt;br /&gt;
&lt;br /&gt;
We want to graph the number of new uniq files a day, I used the following query to make sqlite create the dataset which can be used to graph.&lt;br /&gt;
&lt;br /&gt;
SELECT &lt;br /&gt;
	strftime(&amp;#039;%Y-%m-%d&amp;#039;,connection_timestamp,&amp;#039;unixepoch&amp;#039;,&amp;#039;localtime&amp;#039;) AS date,&lt;br /&gt;
	MAX(downloads.download) AS total,&lt;br /&gt;
	COUNT(downloads.download) AS today,&lt;br /&gt;
	(&lt;br /&gt;
		SELECT &lt;br /&gt;
			COUNT(DISTINCT x.download_md5_hash) &lt;br /&gt;
		FROM &lt;br /&gt;
			downloads AS x &lt;br /&gt;
		NATURAL JOIN &lt;br /&gt;
			connections AS c &lt;br /&gt;
		WHERE &lt;br /&gt;
			strftime(&amp;#039;%Y-%m-%d&amp;#039;,c.connection_timestamp,&amp;#039;unixepoch&amp;#039;,&amp;#039;localtime&amp;#039;) &lt;br /&gt;
			&amp;lt;= strftime(&amp;#039;%Y-%m-%d&amp;#039;,connections.connection_timestamp,&amp;#039;unixepoch&amp;#039;,&amp;#039;localtime&amp;#039;)&lt;br /&gt;
	) AS uniq,&lt;br /&gt;
	(&lt;br /&gt;
		SELECT &lt;br /&gt;
			COUNT(*) &lt;br /&gt;
		FROM&lt;br /&gt;
			(&lt;br /&gt;
				SELECT&lt;br /&gt;
					a.download_md5_hash&lt;br /&gt;
				FROM &lt;br /&gt;
					downloads AS a&lt;br /&gt;
				JOIN &lt;br /&gt;
					connections AS b ON(a.connection = b.connection)&lt;br /&gt;
				GROUP BY &lt;br /&gt;
					a.download_md5_hash&lt;br /&gt;
				HAVING &lt;br /&gt;
					strftime(&amp;#039;%Y-%m-%d&amp;#039;,MIN(b.connection_timestamp),&amp;#039;unixepoch&amp;#039;,&amp;#039;localtime&amp;#039;) &lt;br /&gt;
					= strftime(&amp;#039;%Y-%m-%d&amp;#039;,MAX(connections.connection_timestamp),&amp;#039;unixepoch&amp;#039;,&amp;#039;localtime&amp;#039;)&lt;br /&gt;
			)&lt;br /&gt;
	)AS uniq_this_day,&lt;br /&gt;
	(&lt;br /&gt;
		SELECT &lt;br /&gt;
			COUNT(*) &lt;br /&gt;
		FROM&lt;br /&gt;
			(&lt;br /&gt;
				SELECT&lt;br /&gt;
					MIN(a.download) AS download&lt;br /&gt;
				FROM &lt;br /&gt;
					downloads AS a&lt;br /&gt;
				JOIN &lt;br /&gt;
					connections AS b ON(a.connection = b.connection)&lt;br /&gt;
				GROUP BY &lt;br /&gt;
					a.download_md5_hash&lt;br /&gt;
				HAVING &lt;br /&gt;
					strftime(&amp;#039;%Y-%m-%d&amp;#039;,MIN(b.connection_timestamp),&amp;#039;unixepoch&amp;#039;,&amp;#039;localtime&amp;#039;) &lt;br /&gt;
				= strftime(&amp;#039;%Y-%m-%d&amp;#039;,connections.connection_timestamp,&amp;#039;unixepoch&amp;#039;,&amp;#039;localtime&amp;#039;)&lt;br /&gt;
			) AS newdownloads&lt;br /&gt;
			NATURAL JOIN downloads&lt;br /&gt;
		WHERE &lt;br /&gt;
			download_url LIKE &amp;#039;logxmpp://%&amp;#039;&lt;br /&gt;
	)AS uniq_this_day_via_logxmpp&lt;br /&gt;
FROM &lt;br /&gt;
	downloads&lt;br /&gt;
NATURAL JOIN &lt;br /&gt;
	connections&lt;br /&gt;
GROUP BY&lt;br /&gt;
	date&lt;br /&gt;
ORDER BY&lt;br /&gt;
	date DESC;&lt;br /&gt;
&lt;br /&gt;
uniqfiles.sql&lt;br /&gt;
performance&lt;br /&gt;
&lt;br /&gt;
The queries performance is horrible, for each day we run 3 subqueries, 2 of these subqueries have another subquery. The grouping by the generated date-string is suboptimal too, still the query takes about a second on a moderate sized database. Running the query on the paris and berlin databases took ~90s for berlin, and ~679s for paris. When working with really large databases, it might be usefull to create a temp table with the data which is required in the representation which is used.&lt;br /&gt;
create the dataset&lt;br /&gt;
&lt;br /&gt;
sqlite3 /opt/dionaea/var/dionaea/logsql.sqlite&lt;br /&gt;
.timer on&lt;br /&gt;
.output uniqfiles.txt&lt;br /&gt;
.read uniqfiles.sql&lt;br /&gt;
CPU Time: user 1.850000 sys 0.000000&lt;br /&gt;
&lt;br /&gt;
gnuplot&lt;br /&gt;
&lt;br /&gt;
As the “new” files distribution is more or less random, the graphs look like a saw, which makes them hard to get, therefore I decided to smooth the graphs for these numbers, rendering the graph inexact, but giving a good overview of the tendency.&lt;br /&gt;
plot new uniq files&lt;br /&gt;
&lt;br /&gt;
new files&lt;br /&gt;
&lt;br /&gt;
set terminal png size 600,120 nocrop butt font &amp;quot;/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf&amp;quot; 8&lt;br /&gt;
set output &amp;quot;newfiles.png&amp;quot;&lt;br /&gt;
set xdata time&lt;br /&gt;
set timefmt &amp;quot;%Y-%m-%d&amp;quot;&lt;br /&gt;
set format x &amp;quot;%b %d&amp;quot;&lt;br /&gt;
set ylabel &amp;quot;total&amp;quot;&lt;br /&gt;
set y2label &amp;quot;new&amp;quot;&lt;br /&gt;
set y2tics&lt;br /&gt;
set datafile separator &amp;quot;|&amp;quot;&lt;br /&gt;
plot &amp;#039;uniqfiles.txt&amp;#039; using 1:4 title &amp;quot;uniq&amp;quot; with lines, &amp;quot;&amp;quot; using 1:6 smooth bezier title &amp;quot;new uniq&amp;quot; with lines axes x1y2, &amp;quot;&amp;quot; using 1:5 smooth bezier title &amp;quot;new xmpp&amp;quot; with  lines axes x1y2&lt;br /&gt;
&lt;br /&gt;
plot total files&lt;br /&gt;
&lt;br /&gt;
total files&lt;br /&gt;
&lt;br /&gt;
set terminal png size 800,160 nocrop butt font &amp;quot;/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf&amp;quot; 8&lt;br /&gt;
set output &amp;quot;totalfiles.png&amp;quot;&lt;br /&gt;
set xdata time&lt;br /&gt;
set timefmt &amp;quot;%Y-%m-%d&amp;quot;&lt;br /&gt;
set format x &amp;quot;%b %d&amp;quot;&lt;br /&gt;
set ylabel &amp;quot;total&amp;quot;&lt;br /&gt;
set y2label &amp;quot;downloads&amp;quot;&lt;br /&gt;
set y2tics&lt;br /&gt;
set datafile separator &amp;quot;|&amp;quot;&lt;br /&gt;
plot &amp;#039;uniqfiles.txt&amp;#039; using 1:2 title &amp;quot;total&amp;quot; with lines, &amp;quot;&amp;quot; using 1:3 smooth bezier title &amp;quot;downloads&amp;quot; with lines axes x1y2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Referensi==&lt;br /&gt;
&lt;br /&gt;
* http://carnivore.it/2010/06/06/data_visualisation&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>