<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mansi Sharma on Medium]]></title>
        <description><![CDATA[Stories by Mansi Sharma on Medium]]></description>
        <link>https://medium.com/@mansisharmasidd2?source=rss-3838a9c62615------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*11zQzEbAKpGHyBUmXPAtWg.png</url>
            <title>Stories by Mansi Sharma on Medium</title>
            <link>https://medium.com/@mansisharmasidd2?source=rss-3838a9c62615------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 08:54:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mansisharmasidd2/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Investigating SSH Traffic with Splunk SIEM: A Practical Walkthrough]]></title>
            <link>https://medium.com/@mansisharmasidd2/investigating-ssh-traffic-with-splunk-siem-a-practical-walkthrough-b3417f6a61c1?source=rss-3838a9c62615------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3417f6a61c1</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[log-monitoring]]></category>
            <dc:creator><![CDATA[Mansi Sharma]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 18:18:00 GMT</pubDate>
            <atom:updated>2026-09-29T18:18:00.544Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AkfGryfvW8akZY2sG9GP6Q.png" /></figure><h3>Introduction</h3><p>SSH log files contain valuable information about remote access to servers, including login attempts, commands executed, and session details. Analyzing SSH logs using Splunk SIEM enables security professionals to monitor access to critical systems, detect anomalies, and identify potential security threats.</p><h3><strong>Prerequisites:</strong></h3><ul><li>Splunk Enterprise installed and running</li><li>A HTTP log file to ingest (I used a sample ssh.log.gz)</li></ul><h3>Part 1: Uploading the HTTP Logs</h3><p>From the Splunk Home Page, I choose to add new data input under <strong>Settings -&gt; Add Data</strong>, and then selected Upload as the log input method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*9BVRyEqHFexyR5PS.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*csGU3Umvf2Te-r2K.png" /></figure><p><strong>Step 1 — Select Source</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*y3gCITScoUQYJFAN.png" /></figure><p><strong>Step 2 — Set Source</strong> <strong>Type</strong></p><blockquote>worth reviewing closely, since a bad source type here means messy fields later. I saved this as a custom source type, “<strong>http_logs</strong>”, so I can reuse it across all searches.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KDWlk0wjRvIwKvJnXRDaKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lH0xSKkYHJADJMOTPdJi9A.png" /></figure><p><strong>Step 3 — Input Settings</strong></p><blockquote>I set constant host value and index set as default, because the dataset I used is self-contained and doesn’t require a dedicated index.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*O5Sne51x0w5-wCXS.png" /></figure><p><strong>Step 4 — Review and Submit</strong></p><blockquote>Summary confirms the input type, file, sourcetype, host &amp; index.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*igbu8d-StSGeWrl2.png" /></figure><h3>Part 2: Extracting Fields for Analysis</h3><p>After uploading, navigate to the Extract New Fields in the Splunk interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*QWSxYesoUYOGIGeDKsqXwg.png" /></figure><ul><li>Select any event and click Next.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zGoi9ZXcBvZra6QVDKxLWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FBnHkHKKfThvziCKYmRf4Q.png" /></figure><ul><li>Select Regular Expression (you can use Delimiters too), and click Next.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zwnwli3rom_kCqcHD68Yow.png" /></figure><ul><li>Select field “<strong><em>192.168.202.136&quot; </em></strong>(Source IP), and click Add Extraction.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qd1vHIZSyv_cZSpWkuevnA.png" /></figure><ul><li>Select field “192.168.21.203<strong><em>” </em></strong>(Destination IP), and click Add Extraction.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dXG5JG6quWNs_uLnrn6G3Q.png" /></figure><ul><li>Select field “<strong><em>56815&quot;</em></strong> <strong>src_port, c</strong>lick Add Extraction</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ct8elM8nGBXXv_FtdlmOdw.png" /></figure><ul><li>Select field<strong><em> “22&quot;</em></strong> <strong>dest_port, </strong>click Add Extraction</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ct8elM8nGBXXv_FtdlmOdw.png" /></figure><ul><li>Select field “<strong><em>failed” </em>status, </strong>click Add Extraction</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZkebtuzA4aQdeHG6324YUA.png" /></figure><ul><li>After the Select fields are validate and saved, last step is to check the new extract fields and Click Finish.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pLZKDo9pIoA0ustUchIsTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eaAueyNY58B4oZlIIIymMQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wy0-CpB5DOGH3JGrXlzd_Q.png" /></figure><ul><li>Click on Explore the fields I Just create in Search.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0tfrhtSELfRzxy_UUDDJXA.png" /></figure><ul><li>Interesting Fields now contains the fields we extract <strong>dest_ip, dest_port, status, src_ip, </strong>and<strong> src_port</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*3DS0AaoG1kHtnlKaDNWBMw.png" /></figure><h3>Part 3: Investigating Through the Data</h3><p><strong>1. Security &amp; Authentication Failures</strong></p><p>These queries help you identify potential brute-force attacks or unauthorized access attempts.</p><ul><li><strong>Count failures by Source IP:</strong> Find out which external or internal IP addresses are generating the most failed SSH logins.</li></ul><blockquote>index=* OR index=_* sourcetype=ssh_logs “failure”<br>| stats count by src_ip<br>| sort — count</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tyeRmtj3D3wu6xKfOeXd9Q.png" /></figure><p><strong>Track failures over time (Brute-Force spikes):</strong> Visualizes spikes in authentication failures to identify targeted attack windows.</p><blockquote>index=* OR index=_* sourcetype=ssh_logs “failure”<br>| timechart span=5m count by src_ip</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ALvsSkfiYSVCD5SO43unWw.png" /></figure><p><strong>Identify targeted destination hosts:</strong> See which internal servers are receiving the most failed attempts.</p><blockquote>index=* OR index=_* sourcetype=ssh_logs “failure” | stats count by host, dst_ip | sort — count</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*muBLdf4PlH8PtgtK6w1uFA.png" /></figure><p><strong>2. General Log Summaries &amp; Profiling</strong></p><p>These queries provide a high-level overview of your SSH traffic profile.</p><ul><li><strong>Authentication status breakdown:</strong> See the ratio of failures, undetermined connections, and successes.</li></ul><blockquote>index=* OR index=_* sourcetype=ssh_logs | top limit=20 status</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oqDBu2_cCNrLhXgZFGs0MQ.png" /></figure><p><strong>Top talking IP pairs:</strong> Map out the most active connections between source and destination IP addresses.</p><blockquote>index=* OR index=_* sourcetype=ssh_logs | stats count by src_ip, dst_ip | sort — count</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C3oatS6cePUGeC0ar8k4qg.png" /></figure><p><strong>3. Client &amp; Version Profiling</strong></p><p>Your logs include fields indicating the SSH version string . Monitoring this helps identify outdated clients or anomalous scanning tools.</p><ul><li><strong>Breakdown of SSH Client Versions:</strong> Find out what versions of SSH clients are connecting to your network. Outdated versions might indicate vulnerable systems or automated scanning scripts.</li></ul><blockquote>index=* OR index=_* sourcetype=ssh_logs | rex field=_raw “(?&lt;status&gt;\w+)\s+INBOUND\s+(?&lt;client_ssh&gt;SSH-[^\s]+)\s+(?&lt;server_ssh&gt;SSH-[^\s]+)” | stats count by status, client_ssh</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uq71uYkvLIX-q18PmwE59w.png" /></figure><p><strong>4. Set Up an Automated Alert (Brute-Force Detection)</strong></p><p>This alert triggers if a single source IP generates more than <strong>10 failed SSH logins within a 5-minute window</strong>, which is a strong indicator of an automated brute-force attempt.</p><p><strong>Step 1: The Alert SPL Query</strong></p><blockquote>index=* OR index=_* sourcetype=ssh_logs “failure” | bucket _time span=5m | stats count as failure_count by _time, src_ip, host | where failure_count &gt; 10</blockquote><p>(By using bucket _time span=5m, you create a <strong>5-minute window</strong>. Splunk can then easily count how many times a specific src_ip attacked you <em>within that specific 5-minute block</em>, allowing the alert to correctly trigger if the count goes over 10.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lnXnVBs7enMsn1iJmBZ1Yg.png" /></figure><p><strong>Step 2: Save as an Alert</strong></p><ol><li>Click <strong>Save As</strong> in the top-right corner of the search window and select <strong>Alert</strong>.</li><li>Fill out the alert settings:</li></ol><ul><li><strong>Title:</strong> SSH Brute Force Detection Alert</li><li><strong>Alert Type:</strong> Scheduled</li><li><strong>Time Range:</strong> Run every 5 minutes (or use a Cron schedule: */5 * * * *)</li><li><strong>Trigger Conditions:</strong> Trigger if <strong>Number of Results &gt; 0</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWvBrFd2b0CBR_DXYaEYbg.png" /></figure><p>3.<strong> Trigger Actions:</strong> Select <strong>Add Action</strong> to configure how you want to be notified (e.g., Send Email, Webhook, or Add to Triggered Alerts).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*viOXIXNTNVMcMLqq9nqrWg.png" /></figure><h3>Conclusion</h3><p><strong>Splunk SIEM transforms raw SSH server logs into an active defense system</strong> by continuously parsing Linux authentication records to isolate malicious network behavior. By using Search Processing Language (SPL) to extract critical fields like source IPs and target usernames, security teams can instantly flag brute-force attacks, off-hours administrative access, and compromised accounts. This centralized visibility allows organizations to transition from passive log retention to proactive incident response, triggering real-time alerts that shut down unauthorized remote access before a breach occurs.</p><p>~ Mansi Sharma</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3417f6a61c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Investigating HTTP Traffic with Splunk SIEM: A Practical Walkthrough]]></title>
            <link>https://medium.com/@mansisharmasidd2/investigating-http-traffic-with-splunk-siem-a-practical-walkthrough-b49b5555f194?source=rss-3838a9c62615------2</link>
            <guid isPermaLink="false">https://medium.com/p/b49b5555f194</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[logs]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <dc:creator><![CDATA[Mansi Sharma]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 15:00:59 GMT</pubDate>
            <atom:updated>2026-09-27T15:00:59.473Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4xTMJ-Zul2BVx9yWgv1w9g.jpeg" /></figure><h3>Why HTTP Logs Matter?</h3><p>HTTP logs matter because they: Contain valuable information about web server activity, including requests, responses, user agents, and more. Analyzing HTTP logs using Splunk enables security analysts to monitor web traffic, detect anomalies, and identify any potential threats.</p><p>Prerequisites:</p><ul><li>Splunk Enterprise installed and running</li><li>A HTTP log file to ingest (I used a sample http.log)</li></ul><h3>Part 1: Uploading the HTTP Logs</h3><p>From the Splunk Home Page, I choose to add new data input under <strong>Settings -&gt; Add Data</strong>, and then selected Upload as the log input method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LGFJhg3Ji-0fS6XeWrjuSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PCFr8M1jsoLJp2rtuEKBXg.png" /></figure><p><strong>Step 1 — Select Source</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZKyoSc5Wmdxivish1MZGA.png" /></figure><p><strong>Step 2 — Set Source</strong> <strong>Type</strong></p><blockquote>worth reviewing closely, since a bad source type here means messy fields later. I saved this as a custom source type, “<strong>http_logs</strong>”, so I can reuse it across all searches.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FNVRAdf1FTF1SgbSGELU1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*acOCQXdPme-GPQXDbFF0qw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5B_5BIRZ7OSqWshpuI3mg.png" /></figure><p><strong>Step 3 — Input Settings</strong></p><blockquote>I set constant host value and index set as default, because the dataset I used is self-contained and doesn’t require a dedicated index.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QpTpmpqffDJSUk30CbSpDQ.png" /></figure><p><strong>Step 4 — Review and Submit</strong></p><blockquote>Summary confirms the input type, file, sourcetype, host &amp; index.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*farlMzQtLVKGiD8rD6YjXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PepDdPmxpETZk4khapyqmQ.png" /></figure><p>After uploading the HTTP Log dataset, I ran a baseline search to confirm the data landed correctly:</p><blockquote>source=”http.log” host=”&lt;host&gt;” sourcetype=”http_logs”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e8BoT4MbhAEALYWCxZBl5w.png" /></figure><p>I set the time range as “All time” for this first pass, just to confirm every event came in — for anything after this (timecharts especially), I switched to a bounded range like Last 24 hours, since “All time” over a multi-year dataset blows past Splunk’s row limit on tighter spans.</p><h3>Part 2: Extracting Fields for Analysis</h3><p>Raw HTTP log lines pack a lot of information into positional fields with no labels. To actually query on things like source IP or status code, those fields need to be extracted. I used Splunk’s Extract Fields wizard rather than hand-writing regex from scratch.</p><p><strong>Select Sample. </strong>I picked a representative event from the “http_logs” source type to build the extraction against.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZq-aMiZJW3eJcvZtAmbpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VESspEPv1xj0bKe64w24YQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Frye9GaMvKKijTlI2JPimw.png" /></figure><p><strong>Select Fields:</strong> I manually tagged each positional value with a meaningful field name:</p><p>. src_ip — the client’s address</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ry6YL-L9j-mGW2V44gtFsg.png" /></figure><p>. src_port — the source port used for the request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LdS70ZgN0wcgMmXTBUwwAQ.png" /></figure><p>. dst_ip — the web server queried</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cTUL6Mdf6MSo076W6ti_Tg.png" /></figure><p>. dst_port — destination port (80/443 for HTTP/HTTPS)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J4cQmXVcLawhwWRiBHS3Nw.png" /></figure><p>. method — the request method (GET, POST, etc.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejmIu5wDVVYh9I1jGufQRQ.png" /></figure><p>. status_code — the response status code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hmlASi95VrRDMPQjCloO5Q.png" /></figure><h3>Validate</h3><p>Before saving, I validated the extraction against the sample set, removing any incorrectly highlighted values so the regex generalizes cleanly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kS8xSenLEQFAre_GgCRzPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQRr7rd_zic7DcmTNF0fdg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wr32XGbYCwoUgkEqe447OA.png" /></figure><p>Save Re-running the search now shows fully structured fields alongside the raw event — this is what makes statistical analysis possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wr32XGbYCwoUgkEqe447OA.png" /></figure><h3>Part 3: Investigating Through the Data</h3><p><strong>Which methods make up most of the traffic?</strong></p><blockquote>index=* sourcetype=http_logs | stats count by method</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YYbPOs94n4idwaR7NdhPgg.png" /></figure><p><strong>Limiting:</strong></p><blockquote>index=_* OR index=* sourcetype=http_logs | top limit=10 dst_ip</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xEtqYel3mJHkYaDxMTILQ.png" /></figure><blockquote>index=_* OR index=* sourcetype=http_logs dst_ip=”192.168.229.101” | top limit=10 dst_ip</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yebEiHCDcXOAo0aF2Q46rQ.png" /></figure><p><strong>Isolating just the error responses:</strong></p><blockquote>index=* sourcetype=http_logs | stats count by status | where status &gt;= 400</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w4QfKxjx9nARznucU6jzbA.png" /></figure><p>A few status codes stood out beyond the usual 200/304 noise — a cluster of 404s worth tracing back to their source, and a smaller set of 500s worth a closer look.</p><p><strong>Identifying the source of a 404 spike:</strong></p><blockquote>index=* sourcetype=http_logs status=404 | timechart span=5m count by src_ip</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MBPRp3uCGxl5TK5dliF2sQ.png" /></figure><p>(Note: this one needs a bounded time range — running it over “All time” errors out with “specified span would result in too many rows.”)</p><p><strong>Building a working table for reporting:</strong></p><blockquote>index=* sourcetype=http_logs | table src_ip src_port dst_ip dst_port</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bevjIlwIcGbXHVcSyp4XDw.png" /></figure><blockquote>index=_* OR index=* sourcetype=http_logs | table src_ip, src_port, dst_ip, dst_port, dedup src_ip</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VdiO4huEO1GAGEAD6wQp9Q.png" /><figcaption>dedup removes the duplicates</figcaption></figure><blockquote>index=_* OR index=* sourcetype=http_logs | table src_ip, src_port, dst_ip, dst_port, dedup dst_ip</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MXZmH0dFavgluFkjY_m31g.png" /></figure><p>This kind of table is useful for reports, tickets, or comparing against firewall/proxy logs.</p><p><strong>Takeaways</strong></p><p>Getting HTTP logs into Splunk doesn’t take much effort, but it pays off fast. Once the fields are extracted, a handful of simple queries turn raw web traffic into a clear list of what to investigate :</p><p>— failed logins, scanner-like user agents, error spikes, and request bursts all surface with the same basic</p><p>pattern: stats, timechart, and a where clause.</p><p>The searches that are frequency-based (login failures, 404 spikes, request volume) are worth watching over a bounded, recent time range before turning them into alerts, so the threshold reflects real baseline traffic rather than the entire log history at once.</p><p><strong>This same process :</strong></p><p>— ingest, extract, validate, then hunt</p><p>— works just as well for DNS logs, firewall logs, or any other raw data you want to make searchable in the Splunk SIEM tool.</p><p>Project files and full search queries: <a href="https://github.com/MansiSharma-11/Splunk-Projects/blob/main/Project%202%20%3A%20Analyzing%20HTTP%20Logs.md">GitHub</a></p><p>~ Mansi Sharma</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b49b5555f194" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Investigating DNS Traffic with Splunk SIEM: A Practical Walkthrough]]></title>
            <link>https://medium.com/@mansisharmasidd2/investigating-dns-traffic-with-splunk-siem-a-practical-walkthrough-660570803eda?source=rss-3838a9c62615------2</link>
            <guid isPermaLink="false">https://medium.com/p/660570803eda</guid>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[splunk-enterprise]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Mansi Sharma]]></dc:creator>
            <pubDate>Fri, 25 Sep 2026 18:25:19 GMT</pubDate>
            <atom:updated>2026-09-27T14:59:17.806Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z5azev2V88MOmpHJB87bBw.png" /></figure><h3>Why DNS Logs Matter ?</h3><p>Every device on a network<strong> — </strong>from a laptop to a production server<strong> — </strong>communicates using IP addresses, not names. DNS(Domain Name System) is what lets a human type “example.com” instead of memorizing “192.0.2.44”. That translation happens thousands of times a day on any given network, which is exactly why DNS logs are such a rich data source for detection: malware beaconing, DGA domains, tunneling, and reconnaissance all leave a trail in DNS traffic long before they show up anywhere else.</p><p>This walkthrough documents how I ingested a sample DNS log set into Splunk, extracted the fields needed for analysis, and ran a first pass of hunting queries to surface anomalous activity.</p><h3>prerequisites</h3><p>. Splunk Enterprise is installed and configured (Splunk Installation &amp; Setup Guide).<br>. A DNS log file (I used a sample dns.log)</p><h3><strong>Part 1: Uploading the DNS Logs</strong></h3><p>From the Splunk Home Page, I choose to add new data input under<strong> Settings -&gt; Add Data</strong>, and then selected Upload as the log input method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-HyPUi7Mr5xSZdBxIi9QmA.png" /></figure><p><strong>Step 1 — Select Source</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*udvcOcZKjI-5uMb4azKhsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4a2-8lCvfLgtwieLrfHIQ.png" /><figcaption>I uploaded dns.log from disk</figcaption></figure><p><strong>Step 2 — Set Source Type</strong></p><blockquote>worth reviewing closely, since a bad source type here means messy fields later.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*04ZIGfECi_XXDrGkfukl2Q.png" /></figure><p>I saved this as custom source type, “dnslogs”, so i can reuse it in all searches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bdtgw5oUvJxOgYli-APQVw.png" /></figure><p><strong>Step 3 — Input Settings</strong></p><blockquote>I set constant host value and index set as default, because the dataset i used is self-contained which does not require dedicated index.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2dRChjOZv7Lm0w52sI9iSA.png" /></figure><p><strong>Step 4 — Review and Submit</strong></p><blockquote>Summary confirms the input type, file, sourcetype, host &amp; index .</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQxMMrC96722WYdVCSS1aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V0nUU5ukv_wrEHX5O3a7dg.png" /></figure><p>After uploading the DNS Log dataset, I ran a baseline search to confirm the data landed correctly:</p><blockquote>source=”dns.log” host=”&lt;host&gt;” sourcetype=”dnslogs”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TkrkMzJTdhHo8ibKpDXZvg.png" /><figcaption>I set time range as “All time”</figcaption></figure><h3>Part 2: Extracting Fields for Analysis</h3><p>Raw DNS log lines pack a lot of information into positional fields with no labels. To actually query on things like source IP or query type, those fields need to be extracted. I used Splunk’s <strong>Extract Fields</strong> wizard rather than hand-writing regex from scratch.</p><p><strong>Select Sample.</strong> I picked a representative event from the “dnslogs” source type to build the extraction against.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FYBYkZnRd7a9VpPnynMS_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XLESbQHv5hpdcFCWSda8DQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DND_X2QYvMRCdBJx90rVHQ.png" /></figure><p><strong>Select Fields : </strong>I manually tagged each positional value with a meaningful field name:</p><ul><li>src_ip — the requesting host&#39;s address</li><li>src_port — the source port used for the query</li><li>dst_ip — the DNS server queried</li><li>dst_port— destination port (53 for DNS)</li><li>fqdn— the domain being queried</li><li>record — the query/record type (A, PTR, NB, etc.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QbnoXJOX9SetAwi-0XxkZg.png" /><figcaption>src_ip</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGR-2RLRMMhrXLX4i1LmtA.png" /><figcaption>src_port</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3sTX2QfsbkSafEOGaKaDA.png" /><figcaption>dst_ip</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMQUfoBxlgUgR_jUeaRBHQ.png" /><figcaption>dst_port</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XM4_UE9pwYVktC-vfzEhzw.png" /><figcaption>fqdn</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brm2KcdOqdyO4dqbbXz7gg.png" /><figcaption>record</figcaption></figure><p><strong>Validate</strong></p><p>Before saving, Validate the extraction for sample set, if required remove any incorrectly highlighted values so the regex generalizes cleanly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TnAiTSlUH4dwjUUmAIr2Sw.png" /></figure><p><strong>Save</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pnOOY6ANNsR0cM-m9WtUyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FXAtaYkrf6mC7CFt4o-bKg.png" /></figure><p>Re-running the search now shows fully structured fields alongside the raw event — this is what makes statistical analysis possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ftUVLIqIGivFO5dGJFMDNw.png" /><figcaption>Fields Present in Interesting fields</figcaption></figure><h3>Part 3 : Investigating Through the Data</h3><p><strong>Which domains are being queried most?</strong></p><blockquote>index=* sourcetype=dnslogs | stats count by fqdn</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XTEZSNIWd5SI62iBEcONDw.png" /></figure><p><strong>Narrowing to the top 20 for a cleaner view :</strong></p><blockquote>index=* sourcetype=dnslogs | top limit=20 fqdn</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKWiPM1whHjQyhPHrsQo1g.png" /></figure><p>The top of the list is mostly expected noise — (teredo.ipv6.microsoft.com, time.apple.com, safebrowsing.clients.google.com)</p><p>But a few entries stand out for follow-up: raw PTR lookups like 44.206.168.192.in-addr.arpa appearing over 7,000 times, and repeated WPAD/ISATAP queries, both of which are worth checking against baseline expectations for this environment.</p><p><strong>Drilling into a specific domain:</strong></p><blockquote>index=* sourcetype=dnslogs fqdn=”44.206.168.192.in-addr.arpa”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WMdiMrc9B713Whf0z-P7Q.png" /></figure><p><strong>Identifying the source of that volume:</strong></p><blockquote>index=* sourcetype=dnslogs fqdn=”44.206.168.192.in-addr.arpa” | top limit=3 src_ip</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qXJC5P88h3ewvJyBVLACg.png" /><figcaption>Identifying the source of that volume</figcaption></figure><p>flagged only as a private IP address.</p><p><strong>Building a working table for reporting:</strong></p><blockquote>index=* sourcetype=dnslogs | table src_ip src_port dst_ip dst_port</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R_8-xEvSy5IHlaawIkL6jQ.png" /></figure><p>This kind of table is useful for reports, tickets, or comparing with firewall/proxy logs.</p><h3>Takeaways</h3><p>Getting DNS logs into Splunk dosen’t take much effort, but it pays off fast. Once the fields are extracted, a few simple queries turn raw logs into a clear list of what to investigate. This same process — ingest,extract,validate,then hunt — works just as well for firewall logs, SSH logs, or any other raw data you want to make searchable in Splunk SIEM Tool.</p><p><strong>Project files and full search queries:</strong> <a href="https://github.com/MansiSharma-11/Splunk-Projects/blob/main/Project%201%20%3A%20Analyzing%20DNS%20Logs">GitHub</a></p><p>~ Mansi Sharma</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=660570803eda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Smart Password Checker in Python ‍]]></title>
            <link>https://medium.com/@mansisharmasidd2/building-a-smart-password-checker-in-python-4e513abc9a0d?source=rss-3838a9c62615------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e513abc9a0d</guid>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[tkinter]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mansi Sharma]]></dc:creator>
            <pubDate>Sun, 02 Aug 2026 17:23:46 GMT</pubDate>
            <atom:updated>2026-08-02T17:23:46.694Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HCCz56rel3ZITpKFu1q1Lg.jpeg" /></figure><p>Designing a Password Security Analyzer with Python, Tkinter and zxcvbn</p><h3><strong>1. Introduction</strong></h3><p>Have you ever wondered why some passwords are instantly rejected while others are considered strong?</p><p>Modern password checkers don’t just count characters — they analyze predictability, common patterns, and password entropy.</p><p>Let’s explore how I built one using Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hewVLfmfaoGXrtW4JBO6Og.png" /></figure><h3><strong>2. Why Build a Password Strength Checker?</strong></h3><p>Weak passwords reamin one of the leading causes of compromised online accounts. Unfortunately, many users still rely on predictable passwords that attackers can easily guess.</p><p>I built a Password Strength Checker using Python.Rather than simply counting the passwords length, the application evaluates password strength using intelligent analysis, provides improvement suggestions, generates strong passwords, and supports both GUI &amp; CLI.</p><h3><strong>3. Project Objectives</strong></h3><p>The goal is to build an application that helps users create stronger passwords.</p><p>The application can perform various tasks like :</p><ul><li>Analyze password strength intelligently.</li><li>Detect weak and commonly used passwords.</li><li>Recommend improvements.</li><li>Generate secure passwords.</li><li>Supports both GUI and CLI.</li></ul><h3>4. Key Features</h3><p>Intelligent password strength analysis</p><p>Random strong password generator</p><p>Personalized improvement suggestions</p><p>Export results to JSON</p><p>Desktop GUI + Command-Line Interface</p><p>Clipboard support</p><h3><strong>5. Technology Stack</strong></h3><p>Python (core lang)</p><p>Tkinter (GUI)</p><p>zxcvbn (password strength estimation)</p><p>JSON (exporting analysis reports)</p><p>argparse (CLI)</p><p>Regular Expressions (complexity validation)</p><h3><strong>6. System Architecture</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K1_cNOKVMnGbTr7c06qPpg.png" /></figure><h3>7. Application Workflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*34Fj5rhhGeld6xRdZxZjJA.png" /></figure><h3>8. User Interface Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FzZ-D9adWRE-cpjxpw5LJQ.png" /><figcaption><strong>Entering The Password To Check</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WOKqVH2LGAHXxH5ez4P_TA.png" /><figcaption><strong>Generating Strong Password</strong></figcaption></figure><h3>9. Password Validation Logic</h3><p>Before calculating the password strength, the application performs a series of validation checks. It first verifies the minimum password length, then checks for uppercase letters, lowercase letters, numbers, and special characters. The password is also compares against weak and banned password lists before being analyzed using <strong>zxcvbn</strong> library. Based on these checks, the application provides a strength rating along with personalized suggestions to help users create more secure passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*D74Z_jd4sA6xRbFV2CnuKQ.png" /><figcaption><strong>Validation Workflow</strong></figcaption></figure><h3>10. Password Complexity Checks</h3><pre>complexity_issues = []<br><br>if not re.search(r&#39;[A-Z]&#39;, password):<br>    complexity_issues.append(&quot;uppercase letter&quot;)<br><br>if not re.search(r&#39;[a-z]&#39;, password):<br>    complexity_issues.append(&quot;lowercase letter&quot;)</pre><p>To ensure passwords meet basic security standards, I used Python’s Regular Expressions (Regex) to validate the presence of essential character types.The application checks for uppercase letters, lowercase letters, numbers, and special characters. If any requirement is missing, it records the missing elements and provides personalized feedback, helping users understand how to create stronger and more secure passwords.</p><h3>11. Intelligent Password Strength Evaluation with zxcvbn</h3><pre>password_strength = zxcvbn(password)<br><br>score = password_strength[&quot;score&quot;]<br><br>strength = self.strength_mapping[score]</pre><p>Instead of creating my own password scoring algorithm, I integrated <strong>zxcvbn</strong>, an open-source password strength estimator developed by Dropbox. Unlike simple rule-based validators, zxcvbn evaluates password strength by analyzing common patterns,predictability, and resistance to real-world cracking techniques. Based on its analysis, the application assigns a strength score ranging from <strong>Very Weak</strong> to <strong>Very Strong</strong>,providing users with a more realistic assessment of their password security.</p><h3>12. Secure Random Password Generation</h3><pre>characters = string.ascii_letters + string.digits + string.punctuation<br><br>password = &#39;&#39;.join(<br>    random.choice(characters)<br>    for _ in range(length)<br>)</pre><p>To help user create strong and unpredictable passwords, the application includes a built-in password generator. It combines uppercase letters, lowercase letters, numbers, and special characters to generate a random password . Users can also specify the desired password length, making the generated password both secure and customizable.</p><h3>13. Personalized Security Suggestions</h3><pre>if not re.search(r&#39;\d&#39;, password):<br>    suggestions.append(&quot;Add numbers&quot;)<br><br>if not re.search(r&#39;[A-Z]&#39;, password):<br>    suggestions.append(&quot;Add uppercase letters&quot;)</pre><p>Instead of simply labeling a password as weak, the application provides personalized recommendations based on the missing security requirements. This helps users understand how to improve their passwords by adding elements such as uppercase letters, numbers, or special characters.</p><h3>14. Exporting Password Analysis Reports</h3><pre>with open(file_path, &#39;w&#39;, encoding=&#39;utf-8&#39;) as file:<br>    json.dump(self.results, file, indent=4)</pre><p>The application allows users to export password analysis results in <strong>JSON</strong> format. This feature enables users to save evaluation results for future reference or further analysis. Using JSON provides a lightweight, structured, and widely supported format for storing data</p><h3>15. Supporting Both GUI &amp; CLI Interfaces</h3><p>To make the application more flexible, I designed it to support both a Graphical User Interface (GUI) and a Command-Line Interface (CLI). The GUI provides an intuitive experience for everyday users, while the CLI enables developers and advanced users to quickly check or generate passwords from the terminal. Both interfaces share the same core validation logic, ensuring consistent results while demonstrating code reusability and modular software design.</p><h3>16. Logging and Activity Tracking</h3><pre>logging.info(&quot;Password checked: %s&quot;, result.strength)</pre><p>Logging records important application events, such as password strength evaluations, during execution. This makes it easier to monitor application behavior, troubleshoot issues, and debug problems without interrupting the user experience. It is also a valuable practice for maintaining larger software projects.</p><h3>17. Key Learnings</h3><p>Building this project helped me strengthen both my programming and software engineering skills. Some of the key concepts I learned include:</p><ul><li>Python GUI development using Tkinter</li><li>Object-Oriented Programming (OOP)</li><li>Password security principles</li><li>Regular Expressions (Regex)</li><li>Integrating third-party libraries like <strong>zxcvbn</strong></li><li>JSON data handling</li><li>Application logging and debugging</li><li>Modular software design</li><li>Building applications with both GUI and CLI support</li></ul><h3>18. Future Enhancements</h3><p>Although the application is fully functional, there are several exciting features I would like to add in future versions:</p><ul><li>Real-time password strength meter</li><li>Dark mode interface</li><li>Password breach detection using the <strong>Have I Been Pwned</strong> API</li><li>Password history analysis</li><li>Multi-language support</li><li>Password manager integration</li><li>Export reports in PDF and CSV formats</li><li>Customizable password policies</li></ul><h3><strong>19. CLI Usage</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*-s4XtSz3hZngdNN5pKKNaQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*VoKze0-zV75c_yCSZZVXjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*mP7rwoPQ2Agc-MfGqD4wlg.png" /></figure><p>Happy coding, and keep building!</p><p>— Mansi</p><p>August 2026</p><h3>* GitHub Repository</h3><p>You can explore the complete source code, project documentation, and future updates on my GitHub repository.</p><p>GitHub: <a href="https://github.com/MansiSharma-11/Cloudcredits">password_strength_tester.py</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e513abc9a0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Completed “Build a Musical Instrument Inventory” — freeCodeCamp Python Professional Course…]]></title>
            <link>https://medium.com/@mansisharmasidd2/how-i-completed-build-a-musical-instrument-inventory-freecodecamp-python-professional-course-ca896224ccad?source=rss-3838a9c62615------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca896224ccad</guid>
            <category><![CDATA[freecodecamp]]></category>
            <category><![CDATA[methods]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[class]]></category>
            <dc:creator><![CDATA[Mansi Sharma]]></dc:creator>
            <pubDate>Thu, 30 Jul 2026 17:11:38 GMT</pubDate>
            <atom:updated>2026-07-30T17:16:09.499Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I Completed “Build a Musical Instrument Inventory” — freeCodeCamp Python Professional Course (Step-by-Step Guide with Screenshots)</h3><p>I recently finished the Python Professional Certification on freeCodeCamp,and one of the most interesting hands-on workshop project was “Build a Musical Instrument Inventory” .</p><h4><strong>Step 1: Create Class </strong>MusicalInstrument</h4><p>Start by creating an empty class.</p><pre>class MusicalInstrument:<br>    pass</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sVhCn1n8UqiWjefmg1JMZg.png" /><figcaption>Step 1</figcaption></figure><h4><strong>Step 2: Add the __init__ method</strong></h4><p>Using three parameters.</p><pre>class MusicalInstrument : #class<br>    def __init__ (self,name,instrument_type):<br>        pass</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6wFRMRmcwS3gJUJC2xef0w.png" /><figcaption>Step 2</figcaption></figure><h4>Step 3: Assign name, instrument_type parameters</h4><p>Add self.name = name, self.instrument_type = instrument_type.</p><pre>class MusicalInstrument : #class<br>    def __init__ (self,name,instrument_type): <br>        self.name=name<br>        self.instrument_type=instrument_type</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FSv78EtSWWV-phgIB-nP7A.png" /><figcaption>Step 3</figcaption></figure><h4>Step 4: Create an Instance instrument_1</h4><p>Pass Oboe , woodwind arguments in instrument_1 instance.</p><pre>class MusicalInstrument : #class<br>    def __init__ (self,name,instrument_type): <br>        self.name=name<br>        self.instrument_type=instrument_type<br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXlv80iPH0l7Q7gleUSUIA.png" /><figcaption>Step 4</figcaption></figure><h4>Step 5: Create an Instance instrument_2</h4><p>Pass Trumpet , brass arguments in instrument_1 instance.</p><pre>class MusicalInstrument:<br>    def __init__(self, name, instrument_type):<br>        self.name = name<br>        self.instrument_type = instrument_type<br><br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)<br>instrument_2 = MusicalInstrument(&#39;Trumpet&#39;, &#39;brass&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LYUavxnxId2Cag825TEJYg.png" /><figcaption>Step 5</figcaption></figure><h4>Step 6: Print name,instrument_type attributes of both instances</h4><p>Print instance_name.attribute<strong> .</strong></p><pre>class MusicalInstrument:<br>    def __init__(self, name, instrument_type):<br>        self.name = name<br>        self.instrument_type = instrument_type<br><br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)<br>instrument_2 = MusicalInstrument(&#39;Trumpet&#39;, &#39;brass&#39;)<br><br>print(instrument_1.name)<br>print(instrument_1.instrument_type)<br><br>print(instrument_2.name)<br>print(instrument_2.instrument_type)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xlPSIuF32gebX2ucOtVz8g.png" /><figcaption>Step 6</figcaption></figure><h4>Step 7: Remove all Print Statement</h4><p>Clear print statements.</p><pre>class MusicalInstrument:<br>    def __init__(self, name, instrument_type):<br>        self.name = name<br>        self.instrument_type = instrument_type<br><br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)<br>instrument_2 = MusicalInstrument(&#39;Trumpet&#39;, &#39;brass&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGaGIfrz3ET8g5hT_eq2cw.png" /><figcaption>Step 7</figcaption></figure><h4>Step 8: Create Play Method</h4><p>Add New Method ‘Play’ in same Class.</p><pre>class MusicalInstrument:<br>    def __init__(self, name, instrument_type):<br>        self.name = name<br>        self.instrument_type = instrument_type<br>    def play(self):<br>        pass<br><br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)<br>instrument_2 = MusicalInstrument(&#39;Trumpet&#39;, &#39;brass&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rCEa1JIX197UyvV5U8x_4A.png" /><figcaption>Step 8</figcaption></figure><h4>Step 9: display a message using f-string</h4><p>Print message ‘The [instrument name] is fun to play!’</p><pre>class MusicalInstrument:<br>    def __init__(self, name, instrument_type):<br>        self.name = name<br>        self.instrument_type = instrument_type<br><br>    def play(self):<br>        print(f&#39;The {self.name} is fun to play!&#39;)<br><br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)<br>instrument_2 = MusicalInstrument(&#39;Trumpet&#39;, &#39;brass&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZM1V3tv6qtUJNvlegF2kGg.png" /><figcaption>Step 9</figcaption></figure><h4>Step 10: Create get_fact Method</h4><p>Print message ‘The [name] is part of the [type] family of instruments.’</p><pre>class MusicalInstrument:<br>    def __init__(self, name, instrument_type):<br>        self.name = name<br>        self.instrument_type = instrument_type<br><br>    def play(self):<br>        print(f&#39;The {self.name} is fun to play!&#39;)<br><br>    def get_fact(self):<br>        return f&#39;The {self.name} is part of the {self.instrument_type} family of instruments.&#39;<br><br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)<br>instrument_2 = MusicalInstrument(&#39;Trumpet&#39;, &#39;brass&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHIX3hnzXRMDx7M2WcXV9g.png" /><figcaption>Step 10</figcaption></figure><h4>Step 11: Call the Play Method</h4><p>Call the Method on on your instrument_1 instance.</p><pre>class MusicalInstrument:<br>    def __init__(self, name, instrument_type):<br>        self.name = name<br>        self.instrument_type = instrument_type<br><br>    def play(self):<br>        print(f&#39;The {self.name} is fun to play!&#39;)<br><br>    def get_fact(self):<br>        return f&#39;The {self.name} is part of the {self.instrument_type} family of instruments.&#39;<br><br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)<br>instrument_2 = MusicalInstrument(&#39;Trumpet&#39;, &#39;brass&#39;)<br><br>instrument_1.play()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OFTuNHIBuN8bdTOaV1vaqw.png" /><figcaption>Step 11</figcaption></figure><h4>Step 12: Call the get_fact Method</h4><p>Call the Method on on your instrument_1 instance.</p><pre>class MusicalInstrument:<br>    def __init__(self, name, instrument_type):<br>        self.name = name<br>        self.instrument_type = instrument_type<br><br>    def play(self):<br>        print(f&#39;The {self.name} is fun to play!&#39;)<br><br>    def get_fact(self):<br>        return f&#39;The {self.name} is part of the {self.instrument_type} family of instruments.&#39;<br><br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)<br>instrument_2 = MusicalInstrument(&#39;Trumpet&#39;, &#39;brass&#39;)<br><br>instrument_1.play()<br>print(instrument_1.get_fact())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDUHgerlRJdJdAS7PThr6Q.png" /><figcaption>Step 12</figcaption></figure><h4>Step 13: Call the play, get_fact Methods</h4><p>Call the Methods on on your instrument_1 instance.</p><pre>class MusicalInstrument:<br>    def __init__(self, name, instrument_type):<br>        self.name = name<br>        self.instrument_type = instrument_type<br><br>    def play(self):<br>        print(f&#39;The {self.name} is fun to play!&#39;)<br><br>    def get_fact(self):<br>        return f&#39;The {self.name} is part of the {self.instrument_type} family of instruments.&#39;<br><br>instrument_1 = MusicalInstrument(&#39;Oboe&#39;, &#39;woodwind&#39;)<br>instrument_2 = MusicalInstrument(&#39;Trumpet&#39;, &#39;brass&#39;)<br><br>instrument_1.play()<br>print(instrument_1.get_fact())<br><br>instrument_2.play()<br>print(instrument_2.get_fact())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pFcfNtMG4D2wBKpquTn0kw.png" /><figcaption>Step 13</figcaption></figure><h4>Final Thoughts &amp; What I Learned</h4><p>Congratulations! You’ve just completed one of the most practical workshops in the freeCodeCamp Python Professional Course.</p><p>The <strong>“Build a Musical Instrument Inventory”</strong> project is excellent because it doesn’t just teach theory — it forces you to combine multiple real-world skills:</p><ul><li>Working Classes &amp; Methods</li><li>Instance Creation</li><li>Using the Instances with Methods</li><li>Calling the Methods</li><li>Displaying a Message using f-string</li></ul><p>Thank you for reading! If you got stuck on any step , feel free to drop a comment with the step number — I’ll be happy to help.</p><p>github: MansiSharma-11</p><p>Happy coding, and keep building!</p><p>— Mansi</p><p>July 2026</p><p>(Python Professional Certification — freeCodeCamp)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca896224ccad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Completed “Build a Medical Data Validator” — freeCodeCamp Python Professional Course…]]></title>
            <link>https://medium.com/@mansisharmasidd2/how-i-completed-build-a-medical-data-validator-freecodecamp-python-professional-course-d7d369c4a342?source=rss-3838a9c62615------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7d369c4a342</guid>
            <category><![CDATA[medicaldatavalidator]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[freecodecamp]]></category>
            <category><![CDATA[pythonprofessionalcourse]]></category>
            <dc:creator><![CDATA[Mansi Sharma]]></dc:creator>
            <pubDate>Tue, 07 Apr 2026 16:33:27 GMT</pubDate>
            <atom:updated>2026-07-30T15:40:52.776Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I Completed “Build a Medical Data Validator” — freeCodeCamp Python Professional Course (Step-by-Step Guide with Screenshots)</h3><p>I recently finished the Python Professional Certification on freeCodeCamp, and one of the most valuable hands-on projects was “Build a Medical Data Validator”.</p><h3>Step 1: Initialize the medical_records list</h3><p>Start by declaring an empty list.</p><pre>medical_records = []</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hf6UapqS9MTF8IBJ7F3gsQ.png" /><figcaption>Step 1</figcaption></figure><h3><strong>Step 2: Add the first patient dictionary</strong></h3><p>Add a dictionary with the patient_id key.</p><pre>medical_records = [ <br>    {<br>        &#39;patient_id&#39; : &#39;P1001&#39;<br>    }<br>]<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4GK15G8XiiIii2HwhUrxPA.png" /><figcaption>Step 2</figcaption></figure><h3>Step 3: Add age and gender</h3><p>Add age: 34 and gender: ‘Female’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TM9xgN9mlN98S--4Kbe6Jw.png" /><figcaption>Step 3</figcaption></figure><h3>Step 4: Complete the first dictionary</h3><p>Add diagnosis, medications, and last_visit_id.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uegwl9Ghu8ddlQRceU7dsw.png" /></figure><h3>Step 5: The rest of the data is provided + Start writing the validate() function</h3><p>The platform adds more records. Now create the validate() function and check if the data is a list or tuple.</p><pre>def validate(data):<br>   is_sequence = isinstance(data, (list, tuple))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q9kNvgxh0ctcbQYXBapTEQ.png" /><figcaption>Step 5</figcaption></figure><h3>Step 6: Add the first validation (not a list/tuple)</h3><p>Use not to check the sequence and return False with a message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ShkZLltA9G8RsnNUoBDRQ.png" /><figcaption>Step 6</figcaption></figure><h3>Step 7: Add the is_invalid flag</h3><p>Right after the first if, set is_invalid = False.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w4fxmymzG2Igare_thkYRw.png" /><figcaption>Step 7</figcaption></figure><h3>Step 8: Add the for loop with enumerate()</h3><p>Loop over the data while tracking the index.</p><pre>for index, dictionary in enumerate(data):<br>    pass</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LDvXI94iJESX42PFOsPRVQ.png" /><figcaption>Step 8</figcaption></figure><h3>Step 9: Check if each item is a dictionary</h3><p>Inside the loop, validate that every item is a dict.</p><pre>if not isinstance(dictionary, dict):<br>    print(f&#39;Invalid format: expected a dictionary at position {index}.&#39;)<br>    is_invalid = True</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mS7n63vOCLXof7Ol6U0jHA.png" /><figcaption>Step 9</figcaption></figure><h3>Step 10: Early return if invalid</h3><p>After the loop, if is_invalid is True, return False.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BTBKPl5LhoyqAitBjV_4EQ.png" /><figcaption>Step 10</figcaption></figure><h3>Step 11–12: Test the validate function</h3><p>Call validate(medical_records) at the bottom. You should see <strong>“Valid format.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XzEEzoxn7fmenebIHQoGxw.png" /><figcaption>Step 11</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTjUMdI1ZIRxabF8WAlmLA.png" /><figcaption>Step 12</figcaption></figure><h3>Step 13: Test invalid sequence (string instead of list)</h3><p>Change medical_records to a string to test the first check.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-gO0qH2EQbPq3QTQZgsnxg.png" /><figcaption>Step 13</figcaption></figure><h3>Step 14: Restore medical_records as list of dictionaries</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7PIyjrFs4-Rdpsb4IcUdsQ.png" /><figcaption>Step 14</figcaption></figure><h3>Step 15: Test non-dictionary items</h3><p>Add two non-dictionary items at the end to test the second check.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lM2oGIUaeL45KJyh63iz7g.png" /><figcaption>Step 15</figcaption></figure><h3>Step 16: Clean up the test data</h3><p>Remove the extra non-dictionary items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UfWP-FZydFxE-DY5XGbOCg.png" /><figcaption>Step 16</figcaption></figure><h3>Step 17: Create key_set for required fields</h3><p>Use a set to define the exact keys every dictionary must have.</p><p><em>(Note: This is the step where you define key_set)</em></p><pre>key_set = set([&#39;patient_id&#39;, &#39;age&#39;, &#39;gender&#39;, &#39;diagnosis&#39;, &#39;medications&#39;, &#39;last_visit_id&#39;])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMkHJgPrtHjFizPi_wYlnA.png" /><figcaption>Step 17</figcaption></figure><h3>Step 18: Check for missing or invalid keys</h3><p>Compare dictionary.keys() with key_set.</p><pre>if set(dictionary.keys()) != key_set:<br>    print(f&#39;Invalid format: {dictionary} at position {index} has missing and/or invalid keys.&#39;)<br>    is_invalid = True</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qb21p4RD-raXOGOZnmsIMQ.png" /><figcaption>Step 18</figcaption></figure><h3>Step 19: Test missing key</h3><p>Comment out the ‘age’: 34, line in the first record to test the validation. You should see an “Invalid format… has missing and/or invalid keys” message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KuvofS8IzLZS4nyIS-_nfA.png" /><figcaption>Step 19</figcaption></figure><h3>Step 20: Restore the age line</h3><p>Bring back ‘age’: 34,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Szham1H2VA7XpPH_2oA5uw.png" /><figcaption>Step 20</figcaption></figure><h3><strong>Step 21: Create find_invalid_records() function with empty constraints dict.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFQIX-QnDv_v6OW3SChtDg.png" /><figcaption>Step 21</figcaption></figure><h3><strong>Step 22: Use ** unpacking to test the function.</strong></h3><pre>print(find_invalid_records(**medical_records[0]))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XwsU-Zc5JYZ_DqyaXc8y-g.png" /><figcaption>Step 22</figcaption></figure><h3><strong>Step 23: Add patient_id validation using isinstance.</strong></h3><pre>&#39;patient_id&#39;: isinstance(patient_id, str)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ejDFl7JXN6Pci1F9g_POA.png" /><figcaption>Step 23</figcaption></figure><h3><strong>Step 24: Import re module.</strong></h3><pre>import re</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_Q6V2BaGumIVR7jLtT8yQ.png" /><figcaption>Step 24</figcaption></figure><h3><strong>Step 25: Use re.search() for patient_id.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2yRrrAwwK3i5_oHY1uq5w.png" /><figcaption>Step 25</figcaption></figure><h3><strong>Step 26: Make the regex case-insensitive Add re.IGNORECASE as the third argument to re.search().</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oJOs98ysZoaXqrhzybs2KA.png" /><figcaption>Step 26</figcaption></figure><h3><strong>Step 27: Modify the regex to re.search(‘p\d+’, patient_id, re.IGNORECASE).</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*23gkUuvSBtQzvgf5ebV1CQ.png" /><figcaption>Step 27</figcaption></figure><h3><strong>Step 28: Append the + quantifier so it matches one or more digits: ‘p\d+’.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8_8dzLH98e5ewPqehYuPA.png" /><figcaption>Step 28</figcaption></figure><h3><strong>Step 29: Switch from re.search() to re.fullmatch()</strong></h3><p>Replace the search call with a fullmatch call keeping the same arguments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxe3lTwohEdTnqPu5m0mIQ.png" /><figcaption>Step 29</figcaption></figure><h3>Step 30: Add age type check</h3><pre>&#39;age&#39;: isinstance(age, int)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qXqfNqx9P7_B8NdaCQdhcw.png" /><figcaption>Step 30</figcaption></figure><h3>Step 31: Restrict age to ≥ 18</h3><pre>&#39;age&#39;: isinstance(age, int) and age &gt;= 18</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1GHzsG3BSkfto5jaZGF8MQ.png" /><figcaption>Step 31</figcaption></figure><h3>Step 32: Add gender validation</h3><pre>&#39;gender&#39;: isinstance(gender, str) and gender.lower() in (&#39;male&#39;, &#39;female&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LyaXQeY3-wR0PvQiho6vOg.png" /><figcaption>Step 32</figcaption></figure><h3><strong>Step 33: Add diagnosis validation (string or None)</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S73eWo5JaL0J4Y-7rnEO2Q.png" /><figcaption>Step 33</figcaption></figure><h3><strong>Step 34: Add medications validation (must be a list)</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLgjO4VYvwtPTfSSYid7gA.png" /><figcaption>Step 34</figcaption></figure><h3><strong>Step 35: Ensure all medications are strings using list comprehension</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbqv5qs2u9DAs2z12aWF-w.png" /><figcaption>Step 35</figcaption></figure><h3><strong>Step 36: Use all() for medications check</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q4ABjLLiGCOCH0xJOLTKKQ.png" /><figcaption>Step 36</figcaption></figure><h3><strong>Step 37: Add last_visit_id string check</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wu4VFXMB_RKqtBtS7KbhgQ.png" /><figcaption>Step 37</figcaption></figure><h3>Step 38: Add regex for last_visit_id (v\d+ with IGNORECASE)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_og2IZToX40Mow13J_vDOA.png" /><figcaption>Step 38</figcaption></figure><h3>Step 39: Return only invalid keys with list comprehension</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DDnuJnrDrFfkhCDjl-Vn4w.png" /><figcaption>Step 39</figcaption></figure><h3>Step 40: Filter invalid keys using if not value</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UbyA1554ugVa6ubaNbeAkQ.png" /><figcaption>Step 40</figcaption></figure><h3>Step 41: Remove the temporary test print</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-5FcX6AmeoYq2wABuohsA.png" /><figcaption>Step 41</figcaption></figure><h3>Step 42: Create invalid_records variable in validate()</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bz1jAO5dS3EmlDXTGsjEVQ.png" /><figcaption>Step 42</figcaption></figure><h3>Step 43: Add continue after flagging invalid data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LTBKFAWVQ-297uiE0ahgbw.png" /><figcaption>Step 43</figcaption></figure><h3>Step 44: Print detailed error messages for each invalid key</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRuDZrMbKVXp9yY7hBiF-Q.png" /><figcaption>Step 44</figcaption></figure><h3>Final Thoughts &amp; What I Learned</h3><p>Congratulations! 🎉 You’ve just completed one of the most practical workshops in the freeCodeCamp Python Professional Course.</p><p>The <strong>“Build a Medical Data Validator”</strong> project is excellent because it doesn’t just teach theory — it forces you to combine multiple real-world skills:</p><ul><li>Working with lists of dictionaries</li><li>Type checking with isinstance()</li><li>Regular expressions for strict ID validation</li><li>Using sets to validate exact keys</li><li>List comprehensions with conditions</li><li>Graceful error handling with flags and continue</li></ul><p>These are exactly the kind of techniques used in production data pipelines, backend APIs, and data validation systems.</p><p>If you followed along with the screenshots and steps, you should now see the beautiful 100% complete screen with confetti. That feeling never gets old!</p><p><strong>Pro Tip:</strong> Save this project. You can reuse the validation logic (especially the find_invalid_records() function and regex patterns) in your future portfolio projects or personal tools.</p><p>Thank you for reading! If you got stuck on any step (especially the regex part in Steps 25–29 or the final list comprehension), feel free to drop a comment with the step number — I’ll be happy to help.</p><p>Happy coding, and keep building!</p><p>— Mansi</p><p>April 2026</p><p>(Python Professional Certification — freeCodeCamp)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7d369c4a342" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a Tutor That Remembers Off-By-One Errors]]></title>
            <link>https://medium.com/@mansisharmasidd2/i-built-a-tutor-that-remembers-off-by-one-errors-ec108c329570?source=rss-3838a9c62615------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec108c329570</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[hindsight]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Mansi Sharma]]></dc:creator>
            <pubDate>Sat, 21 Mar 2026 18:28:43 GMT</pubDate>
            <atom:updated>2026-03-21T18:28:43.913Z</atom:updated>
            <content:encoded><![CDATA[<p>Last night I wondered if an agent could remember a student’s off-by-one error across sessions without any database code; by morning, Hindsight had already consolidated three separate solution attempts into a single observation and was using it to personalize the next challenge.</p><p>That moment — watching the memory bank quietly build a profile of someone’s recurring mistakes without me writing a single tracking query — is what this project is actually about. Not the UI, not the challenges, not the Groq integration. The interesting part is what happens when you stop treating agent memory as “just a bigger context window” and start treating it as a first-class system.</p><h3>What CodeMentor AI Does</h3><p>CodeMentor AI is a coding tutor that remembers you. Not in the “we store your chat history” way. In the “we noticed you’ve missed the empty array edge case five times across three sessions and we’re going to keep giving you problems that force you to confront that” way.</p><p>The app has three parts: a chat interface where students ask the AI mentor questions, a code editor panel with curated challenges, and a progress view that shows mistake patterns and a personalized learning path. The stack is deliberately simple — vanilla HTML, CSS, and JavaScript in three files (index.html, styles.css, app.js), deployed on Netlify with serverless functions hiding the API keys. The AI responses come from Groq running llama-3.3-70b-versatile. The memory layer is <a href="https://github.com/vectorize-io/hindsight">Hindsight by Vectorize</a>.</p><p>Every interesting decision in this codebase comes back to how memory is structured. Everything else is plumbing.</p><h3>The Memory Problem I Was Actually Trying to Solve</h3><p>The obvious approach to “agent memory” is to dump the last N messages into the context window and call it done. I’ve done that on other projects. It works until it doesn’t — the moment a student comes back after two days, the context is gone. The moment you have more than one student, you’re mixing everyone’s history. The moment a pattern spans twenty sessions, no context window is big enough to hold it.</p><p>What I actually wanted was something closer to how a good human tutor operates. A human tutor doesn’t re-read the full transcript of every past session before answering. They have an internalized model of the student: “this person consistently rushes the bounds check in binary search” or “strong with recursion, weak with hash maps.” That model was built up over time from repeated observations, and it gets updated — not replaced — as new evidence arrives.</p><p>That’s what <a href="https://vectorize.io/features/agent-memory">Hindsight’s agent memory system</a> gives you. The three core operations are retain(), recall(), and automatic observation consolidation. I&#39;ll walk through how each one is actually used in the code.</p><h3>How retain() Works in Practice</h3><p>Every meaningful event in the app fires a retain() call. Student sends a message — retain it. Agent responds — retain it. Student submits a solution — retain it with metadata about whether they handled edge cases. Student asks for a hint — retain that too, so the agent knows they needed help on this specific problem.</p><p>Here’s the core retain wrapper from app.js:</p><pre>async function hsRetain(content, context = &#39;coding-session&#39;, extra = {}) {<br>  if (CONFIG.demoMode) { logAPI(&#39;retain&#39;, content.substring(0,65)+&#39;…&#39;); return; }<br>  try {<br>    const body = {<br>      items: [{<br>        content,<br>        context,<br>        tags: [STUDENT_TAG(), `lang:${STATE.lang.toLowerCase()}`],<br>        observation_scopes: &#39;per_tag&#39;,<br>        ...extra<br>      }]<br>    };<br>    const r = await fetch(<br>      `${CONFIG.hindsightUrl}/v1/default/banks/${BANK_ID()}/retain`,<br>      { method:&#39;POST&#39;, headers: hsHeaders(), body: JSON.stringify(body) }<br>    );<br>    // ...<br>  }<br>}</pre><p>Two things in here are doing real work. First, STUDENT_TAG() — which resolves to something like student:alex — scopes every memory to a specific student. This means a single Hindsight bank can serve multiple students without their memories bleeding into each other. When student Alex&#39;s recall query runs, it only surfaces memories tagged student:alex.</p><p>Second, observation_scopes: &#39;per_tag&#39;. This is the setting that tells Hindsight to run a separate consolidation pass for each individual tag. So when Alex submits five binary search solutions that all miss the bounds check, Hindsight doesn&#39;t just store five raw facts — it synthesizes them into an observation tagged student:alex that reads something like &quot;student repeatedly misses off-by-one errors in binary search implementations.&quot; That observation then surfaces in every subsequent recall query, without me writing any aggregation logic.</p><p>The context field is doing quiet work too. Hindsight uses it during fact extraction — the same sentence means different things depending on whether the context is &#39;solution-attempt&#39;, &#39;mistake-pattern&#39;, or &#39;progress&#39;. Getting this right improved the quality of what Hindsight extracted from each retain call significantly.</p><h3>The Solution Submission Loop</h3><p>The most interesting retain call happens when a student submits code. Here’s the relevant section from submitSolution():</p><pre>const hasEdge = /if not |if len|if \(!|\.length === 0/.test(code);</pre><pre>await hsRetain(<br>  `${CONFIG.userName} submitted solution for &quot;${ch.title}&quot; in ${STATE.lang}.<br>Edge cases handled: ${hasEdge}.<br>Code:\n${code.substring(0,400)}`,<br>  &#39;solution-attempt&#39;,<br>  {<br>    document_id: `sol-${ch.title.replace(/\s/g,&#39;-&#39;)}-${Date.now()}`,<br>    tags: [STUDENT_TAG(), `lang:${STATE.lang.toLowerCase()}`, `topic:${ch.tags[0]}`, &#39;solution&#39;],<br>    observation_scopes: &#39;per_tag&#39;<br>  }<br>);</pre><pre>if (!hasEdge) {<br>  await hsRetain(<br>    `${CONFIG.userName} submitted without edge case handling for &quot;${ch.title}&quot;. Recurring pattern.`,<br>    &#39;mistake-pattern&#39;,<br>    { tags: [STUDENT_TAG(), &#39;mistake&#39;, &#39;edge-case&#39;], document_id: `mp-ec-${Date.now()}` }<br>  );<br>}</pre><p>The regex hasEdge check is deliberately crude — it&#39;s a heuristic, not a parser. It catches the most common pattern: a guard clause at the top of the function checking for empty input. When it fires false, a second retain call goes out with the mistake and edge-case tags. Over multiple submissions, Hindsight&#39;s consolidation pass builds an observation from those tagged facts. That observation then influences every future response.</p><p>The document_id on the solution retain is intentional. Hindsight uses it for idempotency — if the same document ID is retained twice, the second call replaces the first. This means if we ever re-submit a solution (say, after editing), we don&#39;t accumulate duplicate facts for the same attempt.</p><h3>How recall() Shapes Every Response</h3><p>Before every AI response, the app runs a recall query against the student’s memory bank:</p><pre>async function hsRecall(query) {<br>  const body = {<br>    query,<br>    tags: [STUDENT_TAG()],<br>    tags_match: &#39;any&#39;,<br>    types: [&#39;world&#39;, &#39;experience&#39;, &#39;observation&#39;],<br>    budget: &#39;mid&#39;,<br>    max_tokens: 2000<br>  };<br>  const r = await fetch(<br>    `${CONFIG.hindsightUrl}/v1/default/banks/${BANK_ID()}/recall`,<br>    { method:&#39;POST&#39;, headers: hsHeaders(), body: JSON.stringify(body) }<br>  );<br>  const d = await r.json();<br>  return d.results?.map(m =&gt; `[${m.type}] ${m.text}`).join(&#39;\n&#39;) || &#39;&#39;;<br>}</pre><p>The tags_match: &#39;any&#39; setting is deliberate. It returns memories tagged student:alex <em>plus</em> any untagged global memories — things like general curriculum facts or challenge metadata that should be visible to all students. The types filter pulls all three memory categories: world facts (objective information about the student), experience facts (specific interactions), and observation facts (consolidated patterns). In practice, the observations are the most useful — they&#39;re the synthesized version of what Hindsight has learned.</p><p>The recalled memories go directly into the system prompt via buildMemoryRules():</p><pre>function buildMemoryRules(memoriesText) {<br>  return `Student Behavior Insights (from Hindsight memory):<br>${memoriesText || &#39;No prior data — first session&#39;}</pre><pre>Mentoring rules derived from memory:<br>- Always check edge cases first based on student history<br>- Watch for off-by-one errors (recurring pattern)<br>- Suggest optimal solutions over brute force<br>- Be direct and specific — no generic advice`;<br>}</pre><p>The difference in response quality between a cold start (no memories) and a warmed-up bank (several sessions of data) is noticeable. On a cold start, the agent gives generic advice. After a few sessions, it references specific past mistakes by name, picks challenges that target known weak spots, and skips explanations of things the student has already demonstrated they understand.</p><h3>The Live Code Analyzer</h3><p>One thing I didn’t expect to work as well as it does: a purely client-side static analyzer that fires on every keystroke in the editor. No API calls, no LLM — just regex:</p><pre>function analyzeCode(code) {<br>  return {<br>    hasEdgeCase:       /if\s*\(?.*(length|len).*0|if not/.test(code),<br>    usesLoop:          /(for|while)/.test(code),<br>    nestedLoop:        /(for[\s\S]{0,200}for)/.test(code),<br>    usesHashMap:       /(Map|dict|\{.*:.*\})/.test(code),<br>    recursion:         /return\s+.*\w+\s*\(/.test(code),<br>    timeComplexityHint: (() =&gt; {<br>      if (/(for[\s\S]{0,200}for)/.test(code)) return &#39;O(n²) — nested loops detected&#39;;<br>      if (/(for|while)/.test(code))           return &#39;O(n) — single loop&#39;;<br>      return &#39;O(1) — no loops&#39;;<br>    })()<br>  };<br>}</pre><p>This runs 800ms after the last keystroke and shows a small overlay panel: “⚠️ No edge case check detected” or “⚠️ Nested loops — consider O(n) approach.” It’s wrong in plenty of edge cases — a regex can’t actually parse code — but it catches the right pattern often enough to be useful, and it’s instant. The analysis output also gets injected into the Groq system prompt when the student asks for feedback, so the LLM knows what patterns were already detected before it even reads the code.</p><h3>What Actually Surprised Me</h3><p><strong>Observation consolidation is not instant.</strong> Hindsight runs consolidation asynchronously after retain calls. In the first few minutes of a session, the observations haven’t built up yet. The agent is working from raw facts. After a few interactions, the observations start surfacing and response quality improves. This is probably the right tradeoff — real-time consolidation on every retain would be expensive — but it means the “wow” moment where the agent references a pattern by name doesn’t happen until a few minutes into the session.</p><p><strong>Context labels matter more than I expected.</strong> Early versions of the code used a single generic &#39;coding-session&#39; context for everything. The extracted facts were mediocre — Hindsight couldn&#39;t tell whether a retain was a student question, a solution attempt, or a mentor response. Adding distinct context labels (&#39;solution-attempt&#39;, &#39;mistake-pattern&#39;, &#39;progress&#39;) dramatically improved fact quality. The <a href="https://hindsight.vectorize.io/">Hindsight documentation</a> calls this out explicitly, but I underestimated how much it mattered until I saw the difference.</p><p><strong>CORS is the first thing that will break your demo.</strong> The app is pure frontend. Every Hindsight and Groq call goes directly from the browser. Local file:// URLs block cross-origin requests. The fix is to host on a real domain — even Netlify’s free tier solves it immediately. Don’t test this from a local HTML file and wonder why the retain calls are failing.</p><p><strong>Per-tag observation scoping is the right default for multi-user systems.</strong> Using observation_scopes: &#39;per_tag&#39; means each student gets their own independent observation history. The alternative — combined — would mix all tags into a single observation, which is wrong for this use case. If you&#39;re building any system where multiple identities share a bank, per_tag is probably what you want.</p><h3>Lessons for the Next Project</h3><ul><li><strong>Treat memory as a schema, not a log.</strong> The context, tags, and document_id fields on each retain call are your schema. Getting them right upfront is worth more than any prompt engineering you&#39;ll do later.</li><li><strong>Static analysis + LLM beats LLM alone.</strong> Running analyzeCode() client-side and injecting the results into the system prompt gives the model structured information it can reason about directly. It&#39;s faster, cheaper, and more reliable than asking the model to figure out the code structure from scratch.</li><li><strong>observation_scopes: &#39;per_tag&#39; is almost always the right choice</strong> for multi-user memory banks. It gives you per-identity observations without any custom aggregation code.</li><li><strong>The cold start problem is real.</strong> The first session with a new student produces generic responses because there’s nothing in the memory bank yet. Design for this explicitly — either seed the bank with onboarding data, or make the first-session experience work well without memory context.</li><li><strong>Don’t test cross-origin API calls from local files.</strong> Just deploy to Netlify. It takes four minutes and saves an hour of debugging.</li></ul><p>The code is on GitHub. The memory layer is <a href="https://hindsight.vectorize.io/">Hindsight</a> — worth reading the docs if you’re building anything where an agent needs to learn from repeated interactions rather than just remember the last conversation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KvgsLkmnbBFFHLxondFyLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p1q14WTxlNI2cEtyo9QODQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4yLf1hOLBGwefeNDe5N-RQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M4SiuoKwQFQMm1QNNpTuRw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uO7jvNoaE6iLER-FWk2_xA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*asN3RxJehC0sPjH7cFkkEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nlF-7ZT3HVSfSTual16aQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VSHcixSAwW60yeUtSShlwA.png" /><figcaption>Our Project Screenshots</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UdEOxLkrJIDwZgsF5sEugA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9_ywQeKHqmYKPL5AbV33mA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_gg_kGh4lVQexHbzYnVrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0yI7gv_RBeJlx1qiUDZmbQ.png" /><figcaption>Code Glance</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec108c329570" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>