[{"data":1,"prerenderedAt":421},["ShallowReactive",2],{"blog-finding-devices-with-custom-queries-in-open-audit":3,"authors":270},{"id":4,"title":5,"author":6,"body":7,"categories":252,"category":253,"date":254,"description":255,"extension":256,"featured":257,"fields":252,"image":258,"keyTakeaways":252,"meta":259,"modified":252,"navigation":260,"path":261,"seo":262,"slug":263,"stem":264,"tags":265,"__hash__":269},"blog\u002Fblog\u002Ffinding-devices-with-custom-queries-in-open-audit.md","Finding Devices with Custom Queries in Open-AudIT","Luke Richardson",{"type":8,"value":9,"toc":245},"minimark",[10,14,17,20,23,28,35,38,44,48,51,58,61,90,93,99,102,105,114,125,135,138,142,148,155,189,192,201,204,220,226,231,241],[11,12,13],"p",{},"When considering what a typical network is and what is monitored in it, a few devices usually come to mind; Switches, Routers, HUBs, etc. With the advent of the Internet of Things (IoT) the variety of monitored devices is increasing even further, adding IoT devices such as thermostats along with the devices that regulate them (Microcontrollers, Single-Board-Computers, etc.).",[11,15,16],{},"Without having inventory management software, it becomes challenging to keep track of where and what devices are on your network. FirstWave's Open-AudIT software not only provides in-depth network auditing; it is also easy to create custom queries with this information. These queries allow you to find and organize devices in whatever manner you or your team find best.",[11,18,19],{},"Open-AudIT used as a configuration management database system (one of its many uses) ships with 33 pre-built queries to assist in finding and organizing devices. These queries range from what memory and processors are used, what software is currently installed, to what IP addresses are consumed on the network.",[11,21,22],{},"Understanding that no two networks or organizations are alike, there is a need to have the ability to customize queries to fit your team's needs. Open-AudIT accomplishes this through the use of Custom Queries. A query is essentially a SQL statement that runs against the database to only display the requested filtered items the user has permission to view.",[24,25,27],"h2",{"id":26},"creating-custom-queries","Creating Custom Queries",[11,29,30],{},[31,32],"img",{"alt":33,"src":34},"Open-AudIT query creation interface","\u002Fimages\u002Fblog\u002FOpen-AudIT-features2.png",[11,36,37],{},"A query can be created in Open-AudIT by navigating to the menu -> Manage -> Queries -> Create Queries.",[11,39,40],{},[31,41],{"alt":42,"src":43},"","\u002Fimages\u002Fblog\u002FAdd-a-query-650.png",[24,45,47],{"id":46},"breaking-down-the-sql-query","Breaking Down the SQL Query",[11,49,50],{},"The SQL query can be broken into three parts:",[11,52,53,57],{},[54,55,56],"strong",{},"1. The SELECT statement"," is used to select the data from a database.",[11,59,60],{},"The SELECT section of the query should use full dot notation and also request the field with its full dot name. For example:",[62,63,67],"pre",{"className":64,"code":65,"language":66,"meta":42,"style":42},"language-sql shiki shiki-themes github-light github-dark","SELECT system.id AS `system.id`,\n       system.name AS `system.name`,\n       system.os_name AS `system.os_name`\n","sql",[68,69,70,78,84],"code",{"__ignoreMap":42},[71,72,75],"span",{"class":73,"line":74},"line",1,[71,76,77],{},"SELECT system.id AS `system.id`,\n",[71,79,81],{"class":73,"line":80},2,[71,82,83],{},"       system.name AS `system.name`,\n",[71,85,87],{"class":73,"line":86},3,[71,88,89],{},"       system.os_name AS `system.os_name`\n",[11,91,92],{},"This would cause the query to display the system IDs, system name, and operating system.",[11,94,95,98],{},[54,96,97],{},"2. The FROM clause"," lists the tables, and any joins required for the SQL statement.",[11,100,101],{},"The FROM clause will decide what database you are getting these specific system IDs from and should only contain the tables with the attributes you need.",[11,103,104],{},"For example:",[62,106,108],{"className":64,"code":107,"language":66,"meta":42,"style":42},"FROM system\n",[68,109,110],{"__ignoreMap":42},[71,111,112],{"class":73,"line":74},[71,113,107],{},[11,115,116,117,120,121,124],{},"This specifies which table the ",[68,118,119],{},"system.id"," and ",[68,122,123],{},"system.name"," are coming from.",[11,126,127,130,131,134],{},[54,128,129],{},"3. The WHERE clause"," extracts only those records that fulfil a specified condition. For Open-AudIT to apply user permissions on items, we mandate the use of the ",[68,132,133],{},"WHERE @filter",". If you do not use this format, the query::create form will show a warning.",[11,136,137],{},"Only users with the Admin role are permitted to create queries that lack this attribute.",[24,139,141],{"id":140},"putting-it-together","Putting It Together",[11,143,144],{},[31,145],{"alt":146,"src":147},"Open-AudIT detailed device output for a custom query","\u002Fimages\u002Fblog\u002Fopen-audit-detailed-device.png",[11,149,150,151,154],{},"Continuing with our earlier examples, we can add the clause ",[68,152,153],{},"WHERE @filter AND system.type = 'computer'",". Specifying the type to equal computer will only display devices that are computers, quickly allowing you to filter out all other irrelevant devices. The query has now reached its final form:",[62,156,158],{"className":64,"code":157,"language":66,"meta":42,"style":42},"SELECT system.id AS `system.id`,\n       system.name AS `system.name`,\n       system.os_name AS `system.os_name`\nFROM system\nWHERE @filter\nAND system.type = 'computer'\n",[68,159,160,164,168,172,177,183],{"__ignoreMap":42},[71,161,162],{"class":73,"line":74},[71,163,77],{},[71,165,166],{"class":73,"line":80},[71,167,83],{},[71,169,170],{"class":73,"line":86},[71,171,89],{},[71,173,175],{"class":73,"line":174},4,[71,176,107],{},[71,178,180],{"class":73,"line":179},5,[71,181,182],{},"WHERE @filter\n",[71,184,186],{"class":73,"line":185},6,[71,187,188],{},"AND system.type = 'computer'\n",[11,190,191],{},"This will result in displaying only the system names, IDs, and operating systems of devices that are the system type of computer.",[193,194,195],"blockquote",{},[11,196,197,200],{},[54,198,199],{},"NOTE:"," You are free to select any attributes desired when creating your custom query. To further help in creating queries it is a good idea to use the menu -> Admin -> Database -> List Tables to view the specific table structure. This provides a valuable resource for finding the attributes necessary when creating any custom query.",[11,202,203],{},"Open-AudIT grants you the ability to scan your entire network for devices and organize them in ways that make sense for your team. Inventory management is a breeze with the ability to find, filter, and group any device using custom queries. The growing number of different devices added to networks makes having tools like Open-AudIT in your kit more valuable than ever.",[11,205,206,207,214,215,219],{},"For more information on FirstWave's Open-AudIT, other FirstWave solutions, or to schedule a demonstration, please visit our website at ",[208,209,213],"a",{"href":210,"rel":211},"https:\u002F\u002Fwww.firstwave.com\u002F",[212],"nofollow","www.firstwave.com",". You can also email us at ",[208,216,218],{"href":217},"mailto:contact@firstwave.com","contact@firstwave.com",".",[11,221,222],{},[31,223],{"alt":224,"src":225},"Open-AudIT network directory dashboard","\u002Fimages\u002Fblog\u002Fopen-audit-network-directory-dashboard.png",[227,228,230],"h3",{"id":229},"related-reading","Related reading",[232,233,234],"ul",{},[235,236,237],"li",{},[208,238,240],{"href":239},"\u002Fblog\u002Fcustom-fields-in-open-audit\u002F","Custom Fields in Open-AudIT",[242,243,244],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":42,"searchDepth":80,"depth":80,"links":246},[247,248,249],{"id":26,"depth":80,"text":27},{"id":46,"depth":80,"text":47},{"id":140,"depth":80,"text":141,"children":250},[251],{"id":229,"depth":86,"text":230},null,"Open-AudIT","2022-04-18","Learn how to create custom SQL queries in Open-AudIT to find and organise devices on your network beyond the 33 built-in queries.","md",false,"\u002Fimages\u002Fblog\u002Fopen-audit-all-devices.png",{},true,"\u002Fblog\u002Ffinding-devices-with-custom-queries-in-open-audit",{"title":5,"description":255},"finding-devices-with-custom-queries-in-open-audit","blog\u002Ffinding-devices-with-custom-queries-in-open-audit",[266,267,66,268],"open-audit","queries","how-to","lHVSks5qWMpLwnXtXuBWUbGKhwf4L1AKBGX9rySk6CY",[271,284,297,314,327,340,361,374,387,408],{"id":272,"title":273,"aliases":252,"avatar":252,"body":274,"description":42,"extension":256,"inactive":257,"kind":252,"links":252,"meta":278,"navigation":260,"path":279,"role":252,"seo":280,"slug":281,"stem":282,"tagline":252,"__hash__":283},"authors\u002Fauthors\u002Fchris-jacko.md","Chris Jacko",{"type":8,"value":275,"toc":276},[],{"title":42,"searchDepth":80,"depth":80,"links":277},[],{},"\u002Fauthors\u002Fchris-jacko",{"title":273,"description":42},"chris-jacko","authors\u002Fchris-jacko","-5nEsaQsigkcWpKzYAqcAMNdd5X_63lHLFxBErQh-BY",{"id":285,"title":286,"aliases":252,"avatar":252,"body":287,"description":42,"extension":256,"inactive":257,"kind":252,"links":252,"meta":291,"navigation":260,"path":292,"role":252,"seo":293,"slug":294,"stem":295,"tagline":252,"__hash__":296},"authors\u002Fauthors\u002Fdamian-fielke.md","Damian Fielke",{"type":8,"value":288,"toc":289},[],{"title":42,"searchDepth":80,"depth":80,"links":290},[],{},"\u002Fauthors\u002Fdamian-fielke",{"title":286,"description":42},"damian-fielke","authors\u002Fdamian-fielke","3PEJAVsJcgwSNJ1JITFFtKm4oEaNBZtPdNswW2VTo9U",{"id":298,"title":299,"aliases":300,"avatar":302,"body":303,"description":42,"extension":256,"inactive":257,"kind":307,"links":252,"meta":308,"navigation":260,"path":309,"role":252,"seo":310,"slug":311,"stem":312,"tagline":252,"__hash__":313},"authors\u002Fauthors\u002Ffirstwave-team.md","FirstWave Team",[301],"FirstWave","\u002Fbrand-assets\u002Flogos\u002Ffirstwave\u002Ffirstwave-logo-400x400.png",{"type":8,"value":304,"toc":305},[],{"title":42,"searchDepth":80,"depth":80,"links":306},[],"organization",{},"\u002Fauthors\u002Ffirstwave-team",{"title":299,"description":42},"firstwave-team","authors\u002Ffirstwave-team","Bo2R0Jf6KPnxzN8ZkUNQCgcXInERWo9t7QcDaVG10KA",{"id":315,"title":316,"aliases":252,"avatar":252,"body":317,"description":42,"extension":256,"inactive":257,"kind":252,"links":252,"meta":321,"navigation":260,"path":322,"role":252,"seo":323,"slug":324,"stem":325,"tagline":252,"__hash__":326},"authors\u002Fauthors\u002Fjames-banks.md","James Banks",{"type":8,"value":318,"toc":319},[],{"title":42,"searchDepth":80,"depth":80,"links":320},[],{},"\u002Fauthors\u002Fjames-banks",{"title":316,"description":42},"james-banks","authors\u002Fjames-banks","XUyPfpVxtEsDafIwYwj83M5KT5uOLkuxhJVUkSPy2co",{"id":328,"title":329,"aliases":252,"avatar":252,"body":330,"description":42,"extension":256,"inactive":257,"kind":252,"links":252,"meta":334,"navigation":260,"path":335,"role":252,"seo":336,"slug":337,"stem":338,"tagline":252,"__hash__":339},"authors\u002Fauthors\u002Fjessica-hall.md","Jessica Hall",{"type":8,"value":331,"toc":332},[],{"title":42,"searchDepth":80,"depth":80,"links":333},[],{},"\u002Fauthors\u002Fjessica-hall",{"title":329,"description":42},"jessica-hall","authors\u002Fjessica-hall","WdFYsoJ1la6mKj2UVtjze0aJqOHikzY7rSnpgFXg65k",{"id":341,"title":6,"aliases":252,"avatar":342,"body":343,"description":347,"extension":256,"inactive":257,"kind":252,"links":350,"meta":353,"navigation":260,"path":354,"role":355,"seo":356,"slug":357,"stem":358,"tagline":359,"__hash__":360},"authors\u002Fauthors\u002Fluke-richardson.md","\u002Fimages\u002Fteam\u002Fluke-richardson.jpeg",{"type":8,"value":344,"toc":348},[345],[11,346,347],{},"My focus is on building systems, automations, and highlighting ways FirstWave products can solve the everyday IT Networking nerd.",{"title":42,"searchDepth":80,"depth":80,"links":349},[],{"linkedin":351,"github":352},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Flukedrichardson\u002F","https:\u002F\u002Fgithub.com\u002Fluker-rgb\u002F",{},"\u002Fauthors\u002Fluke-richardson","Head of Marketing",{"title":6,"description":347},"luke-richardson","authors\u002Fluke-richardson","Can't see the woods amongst the trees without Open-AudIT","SZylsD9NCkjp2XdGUuI55Nj2PnQ8OtAWNJGjWvTrigE",{"id":362,"title":363,"aliases":252,"avatar":252,"body":364,"description":42,"extension":256,"inactive":257,"kind":252,"links":252,"meta":368,"navigation":260,"path":369,"role":252,"seo":370,"slug":371,"stem":372,"tagline":252,"__hash__":373},"authors\u002Fauthors\u002Folivia-gribben.md","Olivia Gribben",{"type":8,"value":365,"toc":366},[],{"title":42,"searchDepth":80,"depth":80,"links":367},[],{},"\u002Fauthors\u002Folivia-gribben",{"title":363,"description":42},"olivia-gribben","authors\u002Folivia-gribben","ZSnPtTAye23G8U1Q9gebwWVfVX_tO5E2Mf6D5FfIxEk",{"id":375,"title":376,"aliases":252,"avatar":252,"body":377,"description":42,"extension":256,"inactive":257,"kind":252,"links":252,"meta":381,"navigation":260,"path":382,"role":252,"seo":383,"slug":384,"stem":385,"tagline":252,"__hash__":386},"authors\u002Fauthors\u002Fsarah-lispet.md","Sarah Lispet",{"type":8,"value":378,"toc":379},[],{"title":42,"searchDepth":80,"depth":80,"links":380},[],{},"\u002Fauthors\u002Fsarah-lispet",{"title":376,"description":42},"sarah-lispet","authors\u002Fsarah-lispet","E955cfPrBH-u0nNKbJ-DdAAUhA1JST-Go0EODcGv9LY",{"id":388,"title":389,"aliases":252,"avatar":390,"body":391,"description":395,"extension":256,"inactive":257,"kind":252,"links":398,"meta":400,"navigation":260,"path":401,"role":402,"seo":403,"slug":404,"stem":405,"tagline":406,"__hash__":407},"authors\u002Fauthors\u002Fsharon-hunneybell.md","Sharon Hunneybell","\u002Fimages\u002Fteam\u002Fsharon-hunneybell.png",{"type":8,"value":392,"toc":396},[393],[11,394,395],{},"Over 20 years of experience as a technology leader. Recognised by the AFR as one of Australia's Top 100 Women of Influence in Technology and Innovation. Industry Fellow at Griffith University.",{"title":42,"searchDepth":80,"depth":80,"links":397},[],{"linkedin":399},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fsharonhunneybell\u002F",{},"\u002Fauthors\u002Fsharon-hunneybell","VP of Products",{"title":389,"description":395},"sharon-hunneybell","authors\u002Fsharon-hunneybell","Technology leader with over 20 years in the industry, and an Industry Fellow at Griffith University.","tlbya__xxsO4vAF3WX8gNdnlgdxP-NuSHGQSKO1Zhgs",{"id":409,"title":410,"aliases":252,"avatar":252,"body":411,"description":42,"extension":256,"inactive":257,"kind":252,"links":252,"meta":415,"navigation":260,"path":416,"role":252,"seo":417,"slug":418,"stem":419,"tagline":252,"__hash__":420},"authors\u002Fauthors\u002Fsimon-may.md","Simon May",{"type":8,"value":412,"toc":413},[],{"title":42,"searchDepth":80,"depth":80,"links":414},[],{},"\u002Fauthors\u002Fsimon-may",{"title":410,"description":42},"simon-may","authors\u002Fsimon-may","0in6dS2PIxCquqjG_2uCTM8PAw3O1xyMGHfcNRgCm8w",1788507215470]