|
-
Aug 2nd, 2004, 04:04 PM
#1
Thread Starter
Hyperactive Member
Search Log [RESOLVED]
Hello,
I run a web server, on my server, and there is a log file that logs all the actions that occur. Well, there is tons of different actions per ip address. I want to filter out the whole log file and get the ips, but not showing the same ip twice, so there is a clear list with all the ips. I just need to know a good method, as I know the string commands.
alacritous
Last edited by alacritous; Sep 22nd, 2004 at 08:49 PM.
-
Aug 2nd, 2004, 04:12 PM
#2
One way would be to load all the ip addresses into a temp table
and then run a DISTINCT query and insert the query results into
a final table. Delete the temp table and you are left with a table
of distinct ip addresses.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 2nd, 2004, 08:47 PM
#3
Thread Starter
Hyperactive Member
How would I even find the IPs? I think it starts with one on each line. If it does, then it will be easy. I'll have to show you some of it, sorry I didn't earlier.
It'll be in a little while until I can show you, sorry.
-
Aug 2nd, 2004, 10:51 PM
#4
You should be able to parse the ips out of each line in the log file.
You just need to find something that can be used to designate
the start and end of an ip address. You can use Left, Mid, and
Len to parse it out.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 2nd, 2004, 10:55 PM
#5
Why do you want to know the IP addresses of anybody?
As long as nothing bad has happened, you should just forget about them.
-
Aug 3rd, 2004, 12:21 AM
#6
Frenzied Member
:::`DISCLAIMER`:::
Do NOT take anything i have posted to be truthful in any way, shape or form.
Thank You!
--------------------------------
"Never heard about "hiking" poles. I usualy just grab a stick from the nature, and use that as a pole." - NoteMe
"Finaly I can look as gay as I want..." - NoteMe
Languages: VB6, BASIC, Java, C#. C++
-
Aug 3rd, 2004, 12:32 PM
#7
Thread Starter
Hyperactive Member
I run a webserver, and the statistics don't give a great deal of information. It says how many times ANYONE has visited ANY html page. That also goes for the images and stuff. I would like to know the exact amount of people, and I could, yes, either use a free counter, but I'd rather create my own which would also give more detail.
I am really busy at the moment, but yeah, I figured the len, right, left, mid, all that stuff would work, so I'll just use that and find the end of the ip somehow.
alacritous
Last edited by alacritous; Aug 3rd, 2004 at 12:37 PM.
-
Aug 5th, 2004, 08:10 PM
#8
Thread Starter
Hyperactive Member
Hello,
Sorry, I've been busy for a while. I have filtered out all the IPs, but there are doubles. How can I get rid of the doubles? BTW, it's so big of a file, I had to split it 4 times. But even then, each file is 6,000 lines + so keep that in mind.
Thanks,
alacritous
-
Aug 5th, 2004, 08:16 PM
#9
import them into access, making them a key
this will sort them as well
-
Aug 5th, 2004, 09:04 PM
#10
Or after they are imported into Access, do a SELECT DISTINCT
query and then insert those records into another table. Then
cleanup by deleting the initial table's records.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 5th, 2004, 09:42 PM
#11
Thread Starter
Hyperactive Member
...
code
-
Aug 5th, 2004, 11:06 PM
#12
Thread Starter
Hyperactive Member
-
Aug 6th, 2004, 11:15 AM
#13
Sorry for the delay.
After you import all the records into the TableTemp using ADO or
whatever, run these two queries.
Code:
INSERT INTO
IPVisitors (
IPAddress,
Field2,
Field3)
SELECT DISTINCT
IPAddress,
Field2,
Field3
FROM
TableTemp
ORDER BY
IPAddress ASC;
Code:
DELETE * FROM TableTemp;
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 6th, 2004, 12:40 PM
#14
Thread Starter
Hyperactive Member
Odd...
I didn't ask for it using access... Maybe I should have specified it better before... 
all code please!
alacritous
edit: i know this has nothing to do with this, but I was hoping if someone knew why when I install microsoft office XP it hangs up on the file (sry cant get it right now) something like OWSCLT.DLL and doesn't install.
last time when I reformatted, once I installed winXP service pack it worked, but obviously its not now...
-
Aug 6th, 2004, 12:55 PM
#15
Sorry, but I dont have allot of time to write the program for you.
I need to finish a program for a client. Needs to be under budget.
If you are unsure of how to connect to and insert records into
access then perhaps a search or another thread in the
databases forum. Maybe try first and others will help if you get
stuck.
The queries I gave you will work for either Access or SQL.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 6th, 2004, 05:20 PM
#16
Thread Starter
Hyperactive Member
Originally posted by RobDog888
Sorry, but I dont have allot of time to write the program for you.
I need to finish a program for a client. Needs to be under budget.
If you are unsure of how to connect to and insert records into
access then perhaps a search or another thread in the
databases forum. Maybe try first and others will help if you get
stuck.
The queries I gave you will work for either Access or SQL.
***? Am I speaking?
I know how to do that. Who said I was going to do it that way? I said CODE not records...
I never said to write code for me. I asked how to get rid of doubles. For instance:
It would make:
ip1
ip1
ip2
ip3
ip4
ip4
Into:
ip1
ip2
ip3
ip4
alacritous
-
Aug 6th, 2004, 10:35 PM
#17
And he did give you a solution by dumping the info into a database so you can use SQL to filter out the records you need and transfer them to another table. You can then read of the unique IP addresses off the second table.
Either use that or filter the info manually through an nested iteration of an array or collection.
-
Aug 6th, 2004, 10:40 PM
#18
Thread Starter
Hyperactive Member
Like I said, and I'll say it again which I will probably have to even more. I DO NOT want to dump it.
How would I do it with the array thing?
alacritous
-
Aug 6th, 2004, 10:51 PM
#19
If you dont want to dump it the take the subquery and make it a
permenant query in Access. Then you can use it as the source
for a report. The report will show all ips and no dups. Still
retaining the entire table. No dumping. Dude, I don't appreciate
the 'tude. After all we are helping you for free. I should stop
myself here, so I will.
Import all records into table Table1. Then make this a query and
set it as the recordsource for an Access report.
Done!
Code:
SELECT DISTINCT
IPAddress,
Field2,
Field3
FROM
Table1
ORDER BY
IPAddress ASC;
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 6th, 2004, 10:52 PM
#20
Use a collection
VB Code:
On Error Resume Next
For/Do/While iteration through all IP addresses
strIPAddress = An IP from source structure
colTemp.Add strIPAddress, strIPAddress
If Err Then Err.Clear 'catch error produced with duplicate key hence duplicate IP
Next/Loop/Wend
On Error Goto 0
Resulting collection will be one copy of each IP.
If dont want to iterate throug the struct (eg direct InStr from the file) you can make the collection module level and create an add functiuon(strIP As String) with the error trapping so you don't have to recode the error trap.
Last edited by leinad31; Aug 6th, 2004 at 10:57 PM.
-
Aug 6th, 2004, 11:01 PM
#21
Thread Starter
Hyperactive Member
RobDog888, I don't need people helping me that can't read what I say. Thank you thus far, though.
leinad31, thank you so much. This is perfect!
Thanks!
alacritous
-
Aug 6th, 2004, 11:08 PM
#22
Your welcome, although like you say can't read. Then you should
have been able to read the previous posts to see that the
solution was posted there.
Don't worry, I will not help you again.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|