Splunk Search

how to get a html file including a table into splunk

New Member

Hello,

we are trying to parse an html file to splunk.
We tried it two different ways:

one way was to use the splunk "Website Input" app, the other was to upload the html file.
Both ways werent really working as we expected.
The problem is how to pars the table fields logically. If we use the Website Input we are just able to seperate the fields by different code Points for example the or tag in the table. but if we do so we get fields with the values of a hole line and we have a stats file with hundrets of rows. for example after a Website Input we get a field "field1=Action1 1 12.500 00.016 00.016 00.016 1 100.00 0 0.00 0 0.00 0 0.00 0 0.00 0 0.00" and we would get more than 150 fields in our stats html file. Also the statsfile does not have everytime the same Count of rows depending on the stats, that means field26 is on one day like "field26=Action25 20 20..." and on the other day ist like "field26=Action20 15 10...." so we couldnt say fieldXX=ActionXX everytime...

If we just upload the file we werent able to seperate all the fields. We just get one event with the hole code.

The main Problem is that we would like to have an own event for every row in the tables. As we have more than one table which have different designs it would be much easier if there is a way to force splunk to index one event for each row.
Is there a possibility to Show splunk that this is a table and how to index this table line by line. If this would be possible we could just do a simple field extraction an thats it.

thanks very much

alt text

0 Karma

New Member

This is an example of the html code, but our real code has much more rows:

<html> <head><title>MyStore</title></head><body> <h2>Server</h2><h1>MyStore Statistics</h1><table align="center" border="1" bordercolor="#FFFFFF" cellspacing="0" cellpadding="1" width="100%"><tr><td align="left" valign="top" colspan="2"><h2>General Information:</h2></td></tr><tr><tr><td width=300 align="left" valign="top"><strong>Application Name:</strong></td><td align="left" valign="top">MyStore</td></tr><tr><td width=300 align="left" valign="top"><strong>Software Version:</strong></td><td align="left" valign="top">1.0.1.0</td></tr>
</table><br><table align="center" border="1"  cellspacing="0" cellpadding="1" width="100%"><tr><td align="left" valign="top" colspan="5"><h2>Information(a):</h2></td></tr><tr><td align="left" valign="top"><strong>Type</strong></td><td align="right" valign="top"><strong>Count</strong></td><td align="right" valign="top"><strong>% of Total</strong></td><td align="right" valign="top"><strong>Avg</strong></td><td align="right" valign="top"><strong>Min</strong></td><td align="right" valign="top"><strong>Max</strong></td><td align="right" valign="top"><strong>1/2s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>1s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>2s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>5s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>10s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>> 10s</strong></td><td align="right" valign="top"><strong>%</strong></td></tr><tr><td align="left" valign="top">Login</td><td align="right" valign="top">1</td><td align="right" valign="top">100.000</td><td align="right" valign="top">07.223</td><td align="right" valign="top">07.223</td><td align="right" valign="top">07.223</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">1</td><td align="right" valign="top">100.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td></tr></table><br><table align="center" border="1"  cellspacing="0" cellpadding="1" width="100%"><tr><td align="left" valign="top" colspan="8"><h2>Information(b):</h2></td></tr><tr><td align="left" valign="top"><strong>Name</strong></td><td align="left" valign="top"><strong>Count</strong></td><td align="right" valign="top"><strong>% of Total</strong></td><td align="left" valign="top"><strong>Close</strong></td><td align="left" valign="top"><strong>Active1</strong></td><td align="left" valign="top"><strong>Idle1</strong></td><td align="left" valign="top"><strong>Idle2</strong></td><td align="left" valign="top"><strong>Active2</strong></td><td align="left" valign="top"><strong>Idle3</strong></td></tr><tr><td align="left" valign="top">DB-A</td><td align="left" valign="top">14</td><td align="right" valign="top">53.846</td><td align="left" valign="top">14</td><td align="left" valign="top">150</td><td align="left" valign="top">120</td><td align="left" valign="top">120</td><td align="left" valign="top">0/1</td><td align="left" valign="top">1/1</td></tr><tr><td align="left" valign="top">DB-B</td><td align="left" valign="top">12</td><td align="right" valign="top">46.154</td><td align="left" valign="top">12</td><td align="left" valign="top">30</td><td align="left" valign="top">20</td><td align="left" valign="top">20</td><td align="left" valign="top">0/1</td><td align="left" valign="top">1/1</td></tr></table><br><table align="center" border="1"  cellspacing="0" cellpadding="1" width="100%"><tr><td align="left" valign="top" colspan="5"><h2>Information(c):</h2></td></tr><tr><td align="left" valign="top"><strong>Action</strong></td><td align="right" valign="top"><strong>Count</strong></td><td align="right" valign="top"><strong>% of Total</strong></td><td align="left" valign="top"><strong>Avg</strong></td><td align="right" valign="top"><strong>Min</strong></td><td align="right" valign="top"><strong>Max</strong></td><td align="right" valign="top"><strong>1/2s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>1s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>2s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>5s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>10s</strong></td><td align="right" valign="top"><strong>%</strong></td><td align="right" valign="top"><strong>> 10s</strong></td><td align="right" valign="top"><strong>%</strong></td></tr><tr><td align="left" valign="top">Action1</td><td align="right" valign="top">1</td><td align="right" valign="top">12.500</td><td align="right" valign="top">00.016</td><td align="right" valign="top">00.016</td><td align="right" valign="top">00.016</td><td align="right" valign="top">1</td><td align="right" valign="top">100.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td></tr><tr><td align="left" valign="top">Action2</td><td align="right" valign="top">1</td><td align="right" valign="top">12.500</td><td align="right" valign="top">00.000</td><td align="right" valign="top">00.000</td><td align="right" valign="top">00.000</td><td align="right" valign="top">1</td><td align="right" valign="top">100.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td></tr><tr><td align="left" valign="top">Action3</td><td align="right" valign="top">1</td><td align="right" valign="top">12.500</td><td align="right" valign="top">00.000</td><td align="right" valign="top">00.000</td><td align="right" valign="top">00.000</td><td align="right" valign="top">1</td><td align="right" valign="top">100.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td></tr><tr><td align="left" valign="top">Action4</td><td align="right" valign="top">1</td><td align="right" valign="top">12.500</td><td align="right" valign="top">00.406</td><td align="right" valign="top">00.406</td><td align="right" valign="top">00.406</td><td align="right" valign="top">1</td><td align="right" valign="top">100.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td></tr><tr><td align="left" valign="top">Action5</td><td align="right" valign="top">1</td><td align="right" valign="top">12.500</td><td align="right" valign="top">00.016</td><td align="right" valign="top">00.016</td><td align="right" valign="top">00.016</td><td align="right" valign="top">1</td><td align="right" valign="top">100.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td></tr><tr><td align="left" valign="top">Action6</td><td align="right" valign="top">1</td><td align="right" valign="top">12.500</td><td align="right" valign="top">06.552</td><td align="right" valign="top">06.552</td><td align="right" valign="top">06.552</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">1</td><td align="right" valign="top">100.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td></tr><tr><td align="left" valign="top">Action7</td><td align="right" valign="top">2</td><td align="right" valign="top">25.000</td><td align="right" valign="top">01.513</td><td align="right" valign="top">00.000</td><td align="right" valign="top">03.026</td><td align="right" valign="top">1</td><td align="right" valign="top">50.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">1</td><td align="right" valign="top">50.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td><td align="right" valign="top">0</td><td align="right" valign="top">0.00</td></tr></table><br/></body></html>
0 Karma

SplunkTrust
SplunkTrust

If you could put a sample html file on pastebin and link to it, I'm sure the community will be eager to help.

I think the website input app is a great start. We could really work yourfield called fieldx for example

0 Karma