15 ms·
Tell HN: ChatGPT is fantastic for finding and solving issues in logs
Just paste in a chunk of systemd (or whatever) logs and start asking questions. Often just pasting in the logs and pressing enter results in it identifying potential problems and suggesting solutions. It helped me troubleshoot a huge amount of issues on linux desktops and servers that would have taken me a lot longer with google - even if it doesn't always give the right solution, 99% of the time it at least points to the source of the error and gives me searchable keywords.
Note it works much better with GPT4 - gpt3.5 tends to hallucinate a bit too often.
- swah 3y agoYesterday I dumped a broken markdown table and asked for the first "column" as CSV values. Works really well for this stuff too.
- toomuchtodo 3y agoI love that it’s replacing sed, awk, and cut in the same way you’d bring artillery to a knife fight.
- mrbungie 3y agoI've seen some really f**ed up text formatted files in the wild. In those cases I really see value in using something more "intelligent" (and declarative rather than imperative) rather than coding a non-trivial number of [python|bash] lines of code, especially when dealing with one-timers.
- ogogmad 3y agoI think our operating systems are going to have this stuff installed one day. It might replace most uses of the CLI.
- croes 3y agoBut sed, awk etc.results are predictable and reproducible. That's not guaranteed with ChatGPT.
- femto113 3y agoYou could try asking it to output the sed/awx/etc. commands needed to do the desired transformation reproducibly. If it's not yet good at that it will be soon.
- bostonsre 3y agoIt is good at that and you can only paste so much data into the UI, so usually go this route for complex one liners.
- croes 3y agoThe question is if you can understand the solution if it's complex. Just like the regex for valid email addresses, it may be correct but it's hard to understand it. I see it more as a tool for doing the tedious but simple work, if it's getting complex you get a hard time checking the correctness of the result.
- justsomehnguy 3y agoCasual reminder what you shouldn't try to parse email addresses for a validity with regex, besides checking for '@' aaaaaaaand maybe for '@\w+?\.\w+?' if you are sure the code would only face the globally addressable addresses.
- Veen 3y agoI use it for similar stuff all the time. Yesterday I had a csv full of multi-word hashtags with no spaces between the words. I needed to split them all into separate words, add spaces, and remove the #. It would have been pain to write code to reliably add spaces, especially because many of the hashtags contained non-standard words and abbreviations, but GPT-4 handled it no problem. Saved me hours.
- robbiemitchell 3y agoSame! I had a directory of info coded horribly by some CRM into HTML DIVs (not a table) and copy/pasting it into a text file resulted in a single column of names, contact info, kids, grades, etc. I asked ChatGPT to reformat it into a CSV, noted the useful breaks, requested some transformations and filtering, and specified a delimiter. After 5 minutes of experimentation, it worked like a charm. Absolutely amazing.
- roflyear 3y agoI wish people would focus on these exceptional strengths of the model rather than blabbing about AGI or whatever. Similarly to you, I have been able to find issues with logs, formatting, asking it quick query questions in [whatever flavor of query language XYZ service likes to use], etc.. and it's really, really good. The alternative is to muscle through it, using a lot of energy, writing my own parser or something dumb, or to use Google - which basically isn't usable anymore! But you have people who are like "GPT CODED MY ENTIRE WEBSITE" and "GPT TAUGHT ME QUANTUM PHYSICS" and I'm like... uh... big doubt my man...
- heliophobicdude 3y agoLike Simon said, it's a great language calculator! Also, adapting to its quirks is important. Using the responses from both you and it to scaffold the final response is more effective than giving only one shot
- sharemywin 3y agoI think it does speed up learning a new language(programming) or library. It's not perfect but it's a good companion to a tutorial. or next step past a basic tutorial. especially sample code. I created a script to connect to my email address and pull down my emails. connect to HN and pull done articles to put in sqlite. really quick features, not because it's complicated but because it's tedious.
- roflyear 3y agoRight but you have to be really careful with that use.
- spacebanana7 3y agoYeah, it only takes a small hallucination to delete emails instead of copy them
- 13years 3y ago
- Proven 3y ago[dead]
- greenie_beans 3y agoalso for fixing bugs in a chunk of code. at least, that has worked for me a couple of times. it can be frustrating if it's struggling, feels like you're stuck in a loop and it's hard to break out
- garbagecoder 3y agoI've been telling people the #1 thing I like about ChatGPT is that it breaks my writer's block both in prose and code.
- rwl4 3y agoI let GPT-4 walk me through troubleshooting steps with my extremely slow read times on my SSD-backed KVM virtual machine. It told me the things it needed, I pasted relevant logs and other output, and finally I solved my issue. I was highly impressed! It parsed atop, top, and various other content, explaining exactly what everything meant. Another benefit was that it was able to present a much more readable version of some of what I pasted. I may have to start using it for cleaning up hard-to-read output (looking at you, atop!) in the future, it really excels at that! Also, the issue ended up being that I that I was reading from what turned out to be an NFS mount. Doh!
- squeaky-clean 3y agoUsed it recently to try and diagnose a weird networking issue on a server. It got me pretty far, but then the only next steps it could suggest involved installing some software that wasn't pre-installed. I don't like modifying prod servers by hand, especially because we do the whole infrastructure-as-code thing. So I pinged a more senior engineer, they solved it. I asked what they did. They did exactly what GPT-4 had suggested for me to do. (Don't worry we ended up fixing it "properly" afterwards and re-launched the instance). I'm still not going to trust it when it tells me to do something I don't understand on a prod instance, but that was fun to see.
- bolanyo 3y agosystemd is a very common log. I'm curious whether you think this would work on logs for custom software that by necessity didn't have either its logs or writing about its logs in the training set.
- smabie 3y agoNo need to think, just.. try it and find out?
- bolanyo 3y agoThe author has chosen to 'Tell HN' so it seems reasonable to ask them for further details? I have lots of hard-to-analyse logs but there are constraints which prevent me from sharing them with OpenAI. I am nonetheless curious about whether to do so would be worthwhile or not.
- williamcotton 3y agoConsidering the fact that the RLHF for ChatGPT was done only in English but then worked just as well for every other language I would wager that specific types of logs being present in the training set is less important than it may seem.
- dragonwriter 3y ago> Considering the fact that the RLHF for ChatGPT was done only in English but then worked just as well for every other language Does it work just as well for every other language, or does it work acceptably well for an important subset of other languages?
- moralestapia 3y agoIt truly seems to be the calculator for text.
- ttul 3y agoIt's a calculator for all human knowledge, albeit there are some rounding errors yet to be eliminated.
- qbasic_forever 3y agoNo, only knowledge that was on the internet and specifically on sites like Reddit that were crawled to train the model. This is definitely not all human knowledge!
- aoeusnth1 3y agoWe don’t know how many books and academic papers were in the dataset.
- qbasic_forever 3y agoI can say with absolute certainty they did not include all books with all human knowledge. For example I suspect chat GPT has zero knowledge of how to speak native American languages that have effectively died with no remaining speakers and no complete written history of their exact usage.
- hammyhavoc 3y agoIt also has massive gaps when it comes to problems when porting video games, concepts in game audio like procedural mixing, and even basic stuff like not generating a terribad NGINX config despite being fed the documentation. Anything niche, it's appalling. Anything you can otherwise Google? Sure.
- csomar 3y agoStrong disagree. Will be writing a blog post how GPT-4 understands languages that don't even exist (at least not formally).
- novia 3y agoThere's a company that does this log analysis in real time for you called Zebrium https://www.zebrium.com/ https://www.zebrium.com/
- TacticalCoder 3y agoHow does that work with logs? Logs are often... Huge? How many lines of logs can you paste? Because if I first need to narrow down the log to the problematic part, I kinda already have my problem right there no? Or do you mean I do something like grab the lines with "error" in the log, hoping there aren't too many, then ask ChatGPT what it thinks about this: [ 0.135036] kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20210730/psobject-220)
- waboremo 3y agoWhy wouldn't you use a basic filter on logs before even reading them (or passing them elsewhere)? Maybe even get ChatGPT to write that for you if you're so inclined but it can just be a simple command as grep works fine. After that, even if it's still a massive file, chunking it to ChatGPT should work within its limits (although I haven't personally used it for logs so I can't recommend this).
- akiselev 3y agoThat log line (with the four space at the front for HN formatting) is 40 tokens [1]. You can easily fit several hundred log lines with GPT4 8k context and with the incoming 32K context, you'll be able to fit close to a thousand log lines. That's a lot of context, especially if you can prefilter from relevant services, nodes, etc. or provide a multi-node trace [1] https://platform.openai.com/tokenizer https://platform.openai.com/tokenizer
- skrebbel 3y agoYeah but… i can look through 100 log lines manually faster than writing a good gpt prompt. This would get useful if I can easily paste like 1M lines of logs (a few minutes of data for us), but even if that would work, it’d be prohibitively expensive I think. In other words, I still don’t completely grok the use case that’s being shared here.
- akiselev 3y agoThe use case here is looking through logs for software that aren't familiar, especially stuff that gets touched too infrequently to internalize like, say, driver logs on a Linux workstation. If it's faster for you to read the logs yourself, you should continue to do that. If it's bespoke personal or commercial software, chances are GPT isn't going to be trained on its meaning anyway. Most people aren't going to be familiar with arbitrary ACPI errors. Most people would have to Google or ask GPT to even understand the acronym.
- zeroDivisible 3y agoThis is a great feature and I did use it few times to test. However, be aware of potentially leaking your company's private or sensitive information when doing this.
- sharemywin 3y agohttps://openai.com/policies/api-data-usage-policies https://openai.com/policies/api-data-usage-policies OpenAI will not use data submitted by customers via our API to train or improve our models, unless you explicitly decide to share your data with us for this purpose. You can opt-in to share data. Any data sent through the API will be retained for abuse and misuse monitoring purposes for a maximum of 30 days, after which it will be deleted (unless otherwise required by law). The OpenAI API processes user prompts and completions, as well as training data submitted
- tempaccount420 3y agoThat's API, ChatGPT is different.
- _xivi 3y agoIn the link you provided: > Note that this data policy does not apply to OpenAI's Non-API consumer services like ChatGPT or DALL·E Labs.
- pythonaut_16 3y agoHowever, be aware of potentially leaking your company's private or sensitive information when doing this. Nothing you said negates the potential for leaking your company's private or sensitive information by submitting it to a third party.
- ttul 3y agoI used it to transform cryptic credit card statement items into company names, which then allowed me to query my Gmail archives for receipts and invoices from these vendors, automating a manual process of accounting backup discovery that is the bane of my very existence. I even got GPT-4 to assess whether an email likely relates to an invoice or payment so that I could limit the amount of noise extracted from my email archives. I highly recommend considering GPT-4 every time you encounter a painful manual process. In nearly every case where I have applied GPT-4, it has been successful in one-shot or few-shot solving the problem.
- Rastonbury 3y agoThat's pretty cool and interesting, I wonder how it would know credit card statement lines items or if that's in training data. Do you have an example of a cryptic item, like how is it totally unrelated to the purchase
- ttul 3y agoIt’s so simple it’s embarrassing to admit. I think the prompt is “Here is a credit card statement item. Identify the company: <STATEMENT>” GPT-4 is just that good at one shot classification tasks.
- alphadog 3y agoDid you use the API for this, or did you copy and paste into the GUI?
- ttul 3y agoAPI for sure.
- ChikkaChiChi 3y agoAre you triggering on email received? I'd love to see how you went about this so I can solve some of my own headaches!
- 3y ago
- 2devnull 3y agoAnomaly detection is my current favorite use case for GPTs. Other problems can potentially be recast as anomaly detection that are not currently thought of as such. Regulation for instance.
- 29athrowaway 3y agoYou better ask it to write software to analyze logs rather than analyze logs. Or your OpenAI bill will go to the roof.
- dustymcp 3y agoI concur ive been using it daily for all sorts of tasks, cant read Microsofts docs round it up get the important stuff i love it :)
- programmer_dude 3y agoAwesome! It is also fantastic for understanding chunks of Bash script, Perl, AWK etc where if you don't know something then it's next to impossible to search for it using a non-AI search engine. Bonus: you can also use it to understand what the various flags in a command do.
- bburnett44 3y agoYeah it's truly incredible w scripts
- pachico 3y agoPhind.com is so much better. I just want to pay for the service in exchange of ensuring they won't use my data but I can't find how.
- sundarurfriend 3y agoSame. I've been putting off joining their Discord though (just because I don't use Discord often), maybe there's some info about that there.
- pachico 3y agoPremium has not be released yet.
- sundarurfriend 3y agoWhat will be the difference with Premium?
- pachico 3y agoI have no idea. I guess it will be something like guaranteed availability and privacy options. I'm speculating.
- Aperocky 3y agoCan any of the existing open source models do the same? ChatGPT is great but I don't want all of my queries going to OpenAI. I'd rather shell out a considerable sum to buy the equipment to run my own.
- deleted 3y ago[deleted]
- bumbledraven 3y agoNot even remotely. None of the closed-source models can either.
- fswd 3y agowouldn't embeddings be a better than ChatGPT?
- heliophobicdude 3y agoCan you please elaborate on this? I'm interested in knowing more. :)
- phlip9 3y agoYeah it's pretty awesome! I used GPT-4 last week to fix my corrupted SSD. Granted I already narrowed down the kernel logs to a few suspicious lines, but I just pasted those 10 lines in and asked for a fix. Pasting in GPT's arcane `fsck` incantations and boom -- fixed SSD. Saved me an hour or two of hassle reading man pages and stack overflow posts.
- toyg 3y agoHoly crap, I've seen GPT models hallucinate api calls often enough, I would be shitting my pants when touching anything related to a drive.
- samspenc 3y agoYeah while I use ChatGPT to help with pointers, I would never copy-paste a command directly from ChatGPT into my terminal without doing a bit more research into what exactly those commands were doing.
- busseio 3y agoGreat use case. I have successfully used it in a similar way with SRT files (recording transcripts in SubRip Subtitle format) as well as CSV data from surveys that often has many columns with long text labels (the survey questions) and free text answers. Ex. a prompt I had used for a developer skills survey .csv was: > The CSV data below is the results of a skills survey sent to a group of software engineers. The first row is a header row. Please summarize this data in the areas that the People are Strong, Weak, Most Similar, and Unique: Then, because of things I saw in the response, I asked a few follow-up questions: > How much Azure experience is there in the group? > Can you provide more explanation around your assessment that "Engineers generally have little to no experience with Dockers and Kubernetes." > What other skills and experience do you see in the results that you haven't already mentioned? To address my risk tolerance vis-a-vis the ChatGPT warnings (and previous UI leak of responses), I replaced the email addresses in the .csv file with "PersonA", "PersonB", ...
- csomar 3y agoI used recently to navigate a quite complex Bash script. This is using Codex. I'd go just below the line that I don't understand and type # Explain the line above in detail: << gpt explanation >> And it'd write a very decent explanation that makes sense most of the time. Basically decrypting bash code, which I suck at. However, there was one instance where it almost freaked me out as the output was quite human like: # Explain the line above: <<I don't understand it>>.
- lumb63 3y agoWhat’s wrong with “grep -i error”? That gets me to the source of the error, usually.
- esafak 3y ago1. You don't know what the error means, or how to resolve it. 2. The real error can be surrounded by a wall of other errors and you have to figure out the root cause.
- personjerry 3y agoHow do you deal with the token limit?
- ilyt 3y agoEven free one managed to decipher my 10 years old perl code and I was a bit surprised by it. But in other instance I pasted same function but with parameter name changed (event -> events) and it just produced lies
- kordlessagain 3y agoEven better, give it a sample and have it write regex to find other entries like it.
- penjelly 3y agoyes, but theres a limit to the characters input into chatgpt so you cant always just dump the logs in.
- alecco 3y agoSame for obscure C++ compiler errors. You might need to make a small repro, first.
- kakwa_ 3y agoAs another side note, using ChatGPT as a search engine is not so great. Recently, I was trying to find golang libraries for managing authorization. The first one was a well known library (I was incidentally trying to avoid). But the others 4 were complete were completely fantasy projects. ChatGPT simply invented complete projects with descriptions and github urls. Interestingly, looking at the urls, it seemed to actually be a composition of authors working on the subject and similar project in other languages. I also observed the same behavior when I tried to find community resale/recycling centers (ressourcerie in French) in my neighborhood, and sure enough it generated a bunch of fake addresses. It's logical in hindsight, ChatGPT is a generative AI after all. But these results left me scratching my head at first.
- rrrrrrrrrrrryan 3y agoAre you using ChatGPT Pro? Whenever I hear people criticizing ChatGPT because of hallucinations, I have to ask, because it feels like they've solved 90% of that problem with GPT4.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- mrsiebel 3y ago2023-05-04T04:20:42.199366-04:00 penetrati ngnu dbus-daemon[1196]: [session uid=1000 pid=1196] Successfully activated service ' org.xfce.Xfconf' 2023-05-04T04:21:18.294427-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T04:21:20.447830-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T04:22:59.419150-04:00 penetrati ngnu systemd[1]: Started session-108.scope - Session 108 of User siebel. 2023-05-04T04:25:01.181760-04:00 penetrati ngnu CRON[363165]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) 2023-05-04T04:26:48.757845-04:00 penetrati ngnu systemd[1]: session-78.scope: Deactiv ated successfully. 2023-05-04T04:30:42.121839-04:00 penetrati ngnu dbus-daemon[1196]: [session uid=1000 pid=1196] Activating service name='org.xfc e.Xfconf' requested by ':1.24' (uid=1000 p id=3360 comm="xfce4-panel") 2023-05-04T04:30:42.239103-04:00 penetrati ngnu dbus-daemon[1196]: [session uid=1000 pid=1196] Successfully activated service ' org.xfce.Xfconf' 2023-05-04T04:35:01.251472-04:00 penetrati ngnu CRON[367999]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) 2023-05-04T04:39:01.202453-04:00 penetrati ngnu CRON[369932]: (root) CMD ( [ -x /usr /lib/php/sessionclean ] && if [ ! -d /run/ systemd/system ]; then /usr/lib/php/sessio nclean; fi) 2023-05-04T04:39:01.267940-04:00 penetrati ngnu systemd[1]: Starting phpsessionclean. service - Clean php session files... 2023-05-04T04:39:01.431025-04:00 penetrati ngnu systemd[1]: phpsessionclean.service: Deactivated successfully. 2023-05-04T04:39:01.431258-04:00 penetrati ngnu systemd[1]: Finished phpsessionclean. service - Clean php session files. 2023-05-04T04:40:42.120741-04:00 penetrati ngnu dbus-daemon[1196]: [session uid=1000 pid=1196] Activating service name='org.xfc e.Xfconf' requested by ':1.24' (uid=1000 p id=3360 comm="xfce4-panel") 2023-05-04T04:40:42.214032-04:00 penetrati ngnu dbus-daemon[1196]: [session uid=1000 pid=1196] Successfully activated service ' org.xfce.Xfconf' 2023-05-04T04:40:52.623497-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T04:45:01.213527-04:00 penetrati ngnu CRON[372890]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) 2023-05-04T04:49:37.313682-04:00 penetrati ngnu smartd[746]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Tempera ture_Cel changed from 60 to 61 2023-05-04T04:50:42.117968-04:00 penetrati ngnu dbus-daemon[1196]: [session uid=1000 pid=1196] Activating service name='org.xfc e.Xfconf' requested by ':1.24' (uid=1000 p id=3360 comm="xfce4-panel") 2023-05-04T04:50:42.229128-04:00 penetrati ngnu dbus-daemon[1196]: [session uid=1000 pid=1196] Successfully activated service ' org.xfce.Xfconf' 2023-05-04T04:54:00.082471-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T04:55:01.262268-04:00 penetrati ngnu CRON[377718]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) 2023-05-04T05:00:42.119305-04:00 penetrati ngnu dbus-daemon[1196]: [session uid=1000 pid=1196] Activating service name='org.xfc e.Xfconf' requested by ':1.24' (uid=1000 p id=3360 comm="xfce4-panel") 2023-05-04T05:00:42.199605-04:00 penetrati ngnu dbus-daemon[1196]: [session uid=1000 pid=1196] Successfully activated service ' org.xfce.Xfconf' 2023-05-04T05:01:53.268834-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T05:01:55.324225-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T05:02:02.590368-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T05:02:05.152270-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T05:02:10.779523-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T05:02:18.766764-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T05:02:41.199587-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T05:02:50.721657-04:00 penetrati ngnu wpa_supplicant[913]: wlan0: CTRL-EVEN T-BEACON-LOSS 2023-05-04T05:05:01.237788-04:00 penetrati ngnu CRON[382556]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) 2023-05-04T05:06:43.123423-04:00 penetrati ngnu systemd[1]: Started session-115.scope - Session 115 of User siebel. ┌──(siebel㉿ penetratingnu)-[~] └─$ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������ ������������������������������������������