Anyone know how to search by keyword through loggly JSON logs?
I have JSON logs with a key messageText and if I search for cat i want a log with messageText: "someone took a photo of their cat" which should return about a bajillion results, but instead it returns 0.
I have tried:
search json.messageText:cat
search json.messageText:%cat%
but I'm just gessing at this point. Loggly's help is unhelpful. It's entirely possible that this is not possible.
Try this:
search json.messageText:"*cat*"
I just spent an hour stuck on this one, too. Their "filter system" shows that they do a search on "json.key1.key2 : value8".
BUT, if you want to do the exact same search, you have to type in "key1.key2 : value8", which is essentially the same thing without the "json." at the beginning. The interface is very misleading and confusing about this.
So basically, don't put the "json." and the beginning of searches.
There is no need to type "search" at the beginning.
First, you can do a text-based search, on all fields, by just typing:
cat
Now, if you want to restrict your search to the field json.MessageText:
json.messageText:cat
Related
I am trying to display a word in a field if another field displays something.
Say I have two fields called [Fruit] and [Description]
in [Fruit] would be
RApple
GApple
if [Fruit] states "RApple" I want the [Description] to read "Red Apple" - also would the [Description] save back to the table?
I have tried IIf and I can't get that to work.
I have the same thing working in Excel using ISNUMBER and SEARCH
=IF(ISNUMBER(SEARCH("RApple",B1)),"Red Apple",IF(ISNUMBER(SEARCH("GApple",B1)),"Green Apple")
Can something like this work in Access?
Well, if we were simply testing 2 strings and they were always in that format you provided, it could be as simple as :
IIf([color] = "RApple", "Red Apple", IIf([color] = "GApple", "Green Apple", "No Match"))
To search for the color :
IIf(Left([Fruit],1)="R","Red",IIf(Left([Fruit],1)="G","Green","No Match"))
This would all be better off in VBA, however given the context of your question, it doesn't sound like it's in scope, since this seems like a simple test.
I also agree with #HansUp in stating that this is a bad design with your data. When you can, you want to avoid prying logic out of strings. It would be much better with two fields: [Color] and [Fruit]. From there, you could make the string you so desire if you needed to (RApple, etc.)
Looking at the results of list, there is a lastModifyingUserName, but not a userid or other concrete reference to a user such that I can strongly verify that the file was last modified by me or someone else.
I can approximate this behavior using a string comparison of my user profile information, but this isn't an exact check.
I also looked at the timestamps, and timestamps for a file that was modified by me don't seem to line up, so it doesn't look like I can do this using timestamps either, which looks like a bug in and of itself, e.g.:
"modifiedByMeDate": "2013-01-31T02:25:26.738Z",
"modifiedDate": "2013-01-31T02:29:58.363Z",
Google are working on improving this so that there is consistency between the actor returned in the lastModifyingUserName field and the permission ID.
Right now I agree with you it is pretty impossible, sorry.
In my MySQL DB I have a list of terms like this (With First letters Capital and most of the time plurals)
Hairdressers
Restaurants
Beauty Salons
Furnitures For Restaurants
On my website I have a search bar where the user can search for those word (my website is a kind of POI finder). The search bar has a auto-suggest function, but I'm having problems with my query.
SELECT * FROM TABLE WHERE word = 'userword%'
So if the user enter "Res" it will return all the word starting the "Res". Fair enough, that works, But in my DB i have also words with space between them (Furnitures For Restaurants) and I would like that if the user enter "Res" the mysql query ALSO return Furnitures For Restaurants. I have tried this
SELECT * FROM TABLE WHERE word = '%userword%'
Yes great this works, but... it is a bit to much relax.. it return all and everything, so if the user enters "a" it will return all the word having a in it... And I don't want this.
So how can make the query works only on the FIRST letters of each word ? Exactly like my first query but taking in consideration words with spaces?
Look into mysql FULL Text Search feature. Look at this article too, explains mysql full text searching in a very detailed way.
Each parameter in a URL can have multiple values. How can I separate them? Here's an example:
http://www.example.com/search?queries=cars,phones
So I want to search for 2 different things: cars and phones (this is just a contrived example). The problem is the separator, a comma. A user could enter a comma in the search form as part of their query and then this would get screwed up. I could have 2 separate URL parameters:
http://www.example.com/login?name1=harry&name2=bob
There's no real problem there, in fact I think this is how URLs were designed to handle this situation. But I can't use it in my particular situation. Requires a separate long post to say why... I need to simply separate the values.
My question is basically, is there a URL encodable character or value that can't possibly be entered in a form (textarea or input) which I can use as a separator? Like a null character? Or a non-visible character?
UPDATE: thank you all for your very quick responses. I should've listed the same parameter name example too, but order matters in my case so that wasn't an option either. We solved this by using a %00 URL encoded character (UTF-8 \u0000) as a value separator.
The standard approach to this is to use the same key name twice.
http://www.example.com/search?queries=cars&queries=phones
Most form libraries will allow you to access it as an array automatically. (If you are using PHP (and making use of $_POST/GET and not reinventing the wheel) you will need to change the name to queries[].)
You can give them each the same parameter name.
http://www.example.com/search?query=cars&query=phones
The average server side HTTP API is able to obtain them as an array. As per your question history, you're using JSP/Servlet, so you can use HttpServletRequest#getParameterValues() for this.
String[] queries = request.getParameterValues("query");
Just URL-encode the user input so that their commas become %2C.
Come up with your own separator that is unlikely to get entered in a query. Two underscores '__' for example.
Why not just do something like "||"? Anyone who types that into a search area probably fell asleep on their keyboard :} Then just explode it on the backend.
easiest thing to do would be to use a custom separator like [!!ValSep!!].
I've found boolean mode of MySQL full text search useful, however there are a couple of things I can't seem to figure out how to achieve.
For instance imagine I have a full text column containing the words "Steve's Javascript Tutorial - Part One".
I would like to match this for each of the following searches: "tutorials", "javascript tutorials", "java", "java script", "script"
Imagine that each of those searches is simply assigned to a variable in whatever language may be being used (I always use PHP).
How could I modify this to make sure that Steve's article is returned on each of those searches?
MATCH (article_title) AGAINST ('"+$variable+"*' IN BOOLEAN MODE)
This is impossible ;)
When you search for "tutorials" the entry will not be found, because the entry in the database is singular and the search term is plural. You should do some form of "word stemming" before inserting the values to the database (and on search).
When you have done this, your expression will work. For searrch terms with more words (spaces) you should add the asterix to every word.