From neil.tappsville.com
Jump to navigationJump to search




Match Value (.*) after "want:" and turn it into a field (field_name)

 | rex field=_raw "some text before what we want:(?<field_name>.*)"  

Match field is NULL

NOT field=*

Group results into 1 hour chunks

 | timechart span=1h count(field_name) by field_name 

Export RAW logs

host=<host_name> | table _raw | outputcsv rawdump.csv

Then download as csv

Transforming Commands

| top [field field2] limit=0 showperc=False countfield="Renamed something" 
| Rate [field field2] limit=0

useother=True -- use when limit!=0 so 'extras' go into a catchall bucket

Stats - all stats functions must be done together (in the same pipes)

  • Count
  • Dc (Distinct Count)
  • Sum -- stats sum(price) as "Gross Sales" by product_name
  • Avg, Min, Max
  • List -- stats list(Asset) as "stuff" by Employee
  • Value - similar to list but unique.

IP lookup

| lookup dnslookup clientip as source_ip_field OUTPUT clienthost as output_field


Uses backticks

`comment("why did I add this random string to the search again?")`

Notify about Disabled Alerts

|REST /services/saved/searches | fields title disabled | where title like "IcareaboutX%" AND disabled=1