Woogs
12/21/2018, 6:53 PMWoogs
12/26/2018, 4:34 PM/targets endpoint and specifically the code that does the host querying? I think I might be looking for something like SearchTargets based off what I've read in targets.go?
Seems like there could be some sort of bug in play and want to understand what exactly is happening here.Woogs
12/26/2018, 7:21 PMserver/datastore/mysql/hosts.go - where it's doing something like MATCH(host_name) AGAINST('h*' IN BOOLEAN MODE), where the h* is the user supplied portion of text.
Running that query manually, it mimics the incorrect/missing results I see in the UI. So not entirely what is going wrong with my SQL table/database. I assume the full text index being used for the search is somehow incorrect, but my SQL knowledge is pretty limited.Woogs
12/27/2018, 12:03 AMinnodb_ft_min_token_size is set to 3 and ft_min_word_len is set to 4. In addition, the - can not be used as a token, so when I have systems named something like fo-ba-1, there aren't any tokens available that can be searched on and so searches fail. (Side note, typing - into the select hosts dropdown, results in a 500 error and a SQL error returned)
This was also effecting the ability to search with some IP addresses, especially if your hosts use only 2 digits or less in each octet.
End result, I modified innodb_ft_min_token_size to 1 and rebuilt the FULLTEXT index on the hosts table. This results in getting the appropriate results back for all of my hosts.Woogs
12/27/2018, 12:04 AMdefensivedepth
12/27/2018, 4:12 PMWoogs
12/27/2018, 6:07 PMdefensivedepth
12/27/2018, 6:10 PMWoogs
12/27/2018, 6:31 PMWoogs
12/27/2018, 6:32 PM