How to index a field in service now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2011 04:00 AM
Hello All,
I want to add a filter on the source field of the syslog table.I want to remove the unwanted logs and check only the records where the source field is script.How do I check whether the source field is indexed or not?
Please help.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2011 04:13 AM
var gr = new GlideRecord('syslog');
gr.addQuery('source','script');
gr.query();
while(gr.next())
{
gs.print(gr.message) // this will print the message corresponding to all the source - script.
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2011 04:15 AM
you can do one more thing.
follow the steps
1. go to the syslog table
2. take the mouse pointer to the source column
3. right click on the cell where source = script
4. select the 'show matching'.
this will show all the records that have the source = script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2011 04:16 AM
Thanks for the quick response.
I have already set the module default filter as Source = 'MyLog' .I am curious to know whether the source field is indexed or not.This indexing is similar to what we have in databases to enable quick search/filtering.
Hope I was clear this time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2015 02:42 AM
Hi Bhavesh,
You can check the database indexes present on the 'syslog' table, in the 'Tables & Columns' module, by selecting the 'syslog' table (probably with label 'Log entry'), and expending the indexes list in the 2nd column to the right hand side.
If you need an index created, you should raise an incident with ServiceNow.
Regards,
Hari Valean