{"id":19846533,"url":"https://github.com/ssukhpinder/log.parser","last_synced_at":"2026-05-09T05:05:50.513Z","repository":{"id":254111074,"uuid":"837884729","full_name":"ssukhpinder/Log.Parser","owner":"ssukhpinder","description":"A quick analysis of server logs and displays in tabular format is needed.","archived":false,"fork":false,"pushed_at":"2024-08-04T15:56:36.000Z","size":751,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T12:37:47.832Z","etag":null,"topics":["angular","csharp","dotnet","log","parser","rest","rest-api","visual-studio"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssukhpinder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-04T10:34:20.000Z","updated_at":"2024-08-21T11:21:36.000Z","dependencies_parsed_at":"2024-08-21T13:46:06.662Z","dependency_job_id":"1b5e1163-f12d-4ebf-a664-336670c211e4","html_url":"https://github.com/ssukhpinder/Log.Parser","commit_stats":null,"previous_names":["ssukhpinder/log.parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssukhpinder%2FLog.Parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssukhpinder%2FLog.Parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssukhpinder%2FLog.Parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssukhpinder%2FLog.Parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssukhpinder","download_url":"https://codeload.github.com/ssukhpinder/Log.Parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241225371,"owners_count":19930164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","csharp","dotnet","log","parser","rest","rest-api","visual-studio"],"created_at":"2024-11-12T13:11:45.179Z","updated_at":"2026-05-09T05:05:50.486Z","avatar_url":"https://github.com/ssukhpinder.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Log.Parser\nA quick analysis of server logs and displays in tabular format is needed.\n\n# Problem\nCreate a Frontend on a choice of your technology framework to display the following information (You may also create an output file):\n\n## Task 1\nNumber of accesses to web server per host; sorted, host with most entries is top. The format is similar to the input format (space-separated columns).\n\n### Expected Output\n```\nwpbfl2-45.gate.net 232\nix-mia5-17.ix.netcom.com 25\ntanuki.twics.com 120\n```\n\n## Task 2\nNumber of successful resource accesses by URI. Only “GET” accesses to each URI are to be counted. Only requests which resulted in the HTTP reply code 200 (“OK”) are to be counted.\n\n### Expected Output\n```\n/logos/small_ftp.gif 23\n/icons/people.gif 12\n```\n\n### Sample File\n[Epa-http.txt](https://github.com/ssukhpinder/Log.Parser/blob/main/Log.Parser.Server/epa-http.txt)\n\n### Bonus\nAllow a choice of time span for conversion.\n\n# Prerequisites\n- Visual Studio 2022 Latest Version\n- Install Node\n- Install angular packages using npm\n\n# Solution\nThe technology stack used to solve the above problem is as follows\n- .Net 8 Web API Backend with Swagger Enabled\n- Angular version (17.3.8) with Bootstrap\n\n# Project Breakdown\n| Component          | Description                      |\n| ------------------ | -------------------------------- |\n| log.parser.client  | Angular Code                     |\n| Log.Parser.Server  | REST API .NET 8 Code             |\n| Log.Parser.BL      | Complete business logic          |\n| Log.Parser.Tests   | Test Cases of the REST API Project|\n\n# How to Run the Project\n### Step 1: Clone the following repository using the Github CLI command\n```\ngh repo clone ssukhpinder/Log.Parser\n```\nor using Git Command\n```\ngit clone https://github.com/ssukhpinder/Log.Parser\n```\n\n### Step 2: Open the project in Visual Studio\nOpen the project in Visual Studio, then build the solution by right-clicking on the solution and selecting \"Build Solution.\"\n\n### Step 3: Setup Multi-Project Startup\nOpen the configure startup project dialogue project and make sure the following project actions as \"Start\"\n\n- log.parser.client\n- Log.Parser.Server\n\n![image](https://github.com/user-attachments/assets/18ab74c8-225c-4916-9af3-9d23b35e678a)\n\n### Step 4: Click Start\nAfter successfully building, it should open two applications, Swagger UI and Angular app on the browser, as demonstrated below.\n\n![run](https://github.com/user-attachments/assets/0a0ced24-182b-46cd-a33d-721904e3ff33)\n\n# Other Configurations\nThe REST APIs are protected by CORS policy wherein only certain domain clients can access the APIs if the Angular application is unable to communicate with the .Net backend or running on a port other than 4200.\n\nThen update the following code accordingly [here](https://github.com/ssukhpinder/Log.Parser/blob/main/Log.Parser.Server/Program.cs)\n\n```\n// Apply CORS policy so that APIs are accessible only to the Angular app domain i.e. https://localhost:4200\n// To make it visible for other apps just provide domain names comma-separated or add them to the appsettings.json file\n\nbuilder.Services.UseCorsPolicyHandler(new string[] { \"https://localhost:4200\" });\n```\n\n## Parsing Log file using Log Parser\n\u003e As the data inside the log file is available ONLY for the 29 or 30th of August and the Default value of the year is the current year i.e. 2024\n\n- Choose the log file\n- Select start date and time [Data available for 29th or 30th August 2024]\n- Select end date and time [Data available for 29th or 30th August 2024]\n- Click submit\n\n### Testing Problem 1 using Angular App\nFollow the instructions from Steps 1-4 defined above and then test the Angular UI as follows\n![task1](https://github.com/user-attachments/assets/0fd91a19-908f-4421-840d-f3baee764b90)\n\n### Testing Problem 2 using Angular App\nClick the \"Success Per Uri\" tab in the navigation and similarly follow the instructions as follows\n![task2](https://github.com/user-attachments/assets/c9b4e467-5994-420c-b57a-533afc866e69)\n\n\n# Test Project\nThe parser project also contains test cases written using the xUnit Framework.\n\nThere is a total of 6 test cases as follows\n- TC1: Performing problem task 1 defined above with a single log file entry\n- TC2: Performing problem task 1 defined above with multiple log file entries\n- TC3: Performing problem task 2 defined above with a single log file entry\n- TC4: Performing problem task 2 defined above with multiple log file entries\n- TC5: Performing problem task 1 with invalid content in the log file\n- TC6: Performing problem task 2 with invalid content in the log file\n\n### How to run Test Cases\nOpen Visual Studio \u003e Run All Test Cases or follow the instructions below\n\n![testcase](https://github.com/user-attachments/assets/b10666ff-ea82-4f11-b5e0-292e6370a526)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssukhpinder%2Flog.parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssukhpinder%2Flog.parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssukhpinder%2Flog.parser/lists"}