Show HN: FSQL – Search through your file system with SQL-esque queries
11–20 of 132 posts
Re: Show HN: FSQL – Search through your file system with SQL-esque queries
#12 SELECT distinct(l.name)
FROM lsof l, lsofer_runs r
WHERE l.lsofer_id = r.id
AND fd_type = 'REG'
AND l.fd ~ '[0-9][uw]'
AND l.name like '%log'
GROUP BY l.name, r.hostname
ORDER BY name
Best of luck!Re: Show HN: FSQL – Search through your file system with SQL-esque queries
#13Nice! I'm actually working on a similar project to push lsof and files from /proc into some postgres tables. Lets me do cool things like query log files across a ~6000 server infrastructure similar to: SELECT distinct(l.name) FROM lsof l, lsofer_runs r WHERE l.lsofer_id = r.id AND fd_type = 'REG' AND l.fd ~ '[0-9][uw]' AND l.name like '%log' GROUP BY l.name, r.hostname ORDER BY name Best of luck!
Re: Show HN: FSQL – Search through your file system with SQL-esque queries
#14I think SQL is too verbose for use on the terminal. find + grep does the trick with way less verbose syntax (but also probably less readable). With that said, it is quite cool.
Re: Show HN: FSQL – Search through your file system with SQL-esque queries
#15Nice project, wish you the best ! Although tbh, I personally won't use this simply because I know enough of find(1) to not see the cognitive overhead of switching to sql to do filesystem /queries/. Any examples where this would be better than using find (with the occasional filter thrown in) ?
"select name from foo where name not in (select name from ../bar where date I'm usually fine with `find`, but when doing things more interesting than just "find files in this directory that are not in that directory", while uncommon, tend to make me think about my pipeline a bit.
Re: Show HN: FSQL – Search through your file system with SQL-esque queries
#16Reminds me of osquery [0]. [0] - https://github.com/facebook/osquery
Re: Show HN: FSQL – Search through your file system with SQL-esque queries
#17Nice! I'm actually working on a similar project to push lsof and files from /proc into some postgres tables. Lets me do cool things like query log files across a ~6000 server infrastructure similar to: SELECT distinct(l.name) FROM lsof l, lsofer_runs r WHERE l.lsofer_id = r.id AND fd_type = 'REG' AND l.fd ~ '[0-9][uw]' AND l.name like '%log' GROUP BY l.name, r.hostname ORDER BY name Best of luck!
so you're rewriting osquery? https://osquery.io/
Re: Show HN: FSQL – Search through your file system with SQL-esque queries
#18Nice! I'm actually working on a similar project to push lsof and files from /proc into some postgres tables. Lets me do cool things like query log files across a ~6000 server infrastructure similar to: SELECT distinct(l.name) FROM lsof l, lsofer_runs r WHERE l.lsofer_id = r.id AND fd_type = 'REG' AND l.fd ~ '[0-9][uw]' AND l.name like '%log' GROUP BY l.name, r.hostname ORDER BY name Best of luck!
Re: Show HN: FSQL – Search through your file system with SQL-esque queries
#19Nice project, wish you the best ! Although tbh, I personally won't use this simply because I know enough of find(1) to not see the cognitive overhead of switching to sql to do filesystem /queries/. Any examples where this would be better than using find (with the occasional filter thrown in) ?
Subselects would be a pretty awesome feature. "select name from foo where name not in (select name from ../bar where date I'm usually fine with `find`, but when doing things more interesting than just "find files in this directory that are not in that directory", while uncommon, tend to make me think about my pipeline a bit.
Re: Show HN: FSQL – Search through your file system with SQL-esque queries
#20Reminds me of osquery [0]. [0] - https://github.com/facebook/osquery
[0] https://news.ycombinator.com/item?id=8528460 [1] https://news.ycombinator.com/item?id=12600790