Refine your search:

2
1

Hi there,

I have a saved search that I want to run every day at noon, I am sending the results trough mail and want to analyse them, but the fields order isn't logic.

host="fw.azl.local" type="event" subtype="admin" pri="notice" seq!="" | fields - _* | fields date, time, ui, user, msg, devname, sintf, dintf, saddr, daddr, svr, act

My results are in a different order then the one i am searching for (date, time, etc..) How can i make sure i have the same order in my mail as the search string ?

Thnx !

asked 05 May '10, 11:40

CerielTjuh's gravatar image

CerielTjuh
15810
accept rate: 22%


3 Answers:

I was told by support that the field order difference between the the web GUI and saved searches is a bug and should be resolved in 4.1.4.

link

answered 17 Jun '10, 21:27

kbecker's gravatar image

kbecker
3191114
accept rate: 44%

The script that sends emails out specifically re-orders fields by length of content (field with longest value first). I have modified the script to remove this logic, but yes it would be nice if that is being done permanently.

(17 Jun '10, 22:13) gkanapathy ♦

Thnx guys, I will wait for the new release :)

(18 Jun '10, 06:28) CerielTjuh

The email functionality is driven by a script called 'sendemail.py' in the search app. If you're brave, you can do this: - copy sendemail.py to sendemail-custom.py - make any changes you like in that script - add this to apps/search/local/commands.conf: [sendemail] filename = sendemail-custom.py

Your custom version can do whatever you want it to, but the drawback is you now have to maintain it if Splunk makes changes to the original (for example, the addition of PDF emails in Splunk 4.1)

I use a modified version of the script that adds CSS formatting to the email and re-orders the fields if it sees a 'fields' command in the search string.

link

answered 16 Aug '10, 13:44

southeringtonp's gravatar image

southeringtonp ♦
4.5k1215
accept rate: 35%

What version of Splunk is this? I think that the ordering was an issue prior to 4.0...

link

answered 06 May '10, 20:44

bfaber's gravatar image

bfaber
2201111
accept rate: 26%

Latest version, 4.1.2, I found out yesterday that if i create a new dashboard with the search, the order is fine, only when i create a saved search and let Splunk e-mail me the results it is messed up.

(07 May '10, 06:48) CerielTjuh

That may be a bug -- I'd send it to support@splunk.com...

(07 May '10, 18:37) bfaber
Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1,083
×197
×68
×61
×28

Asked: 05 May '10, 11:40

Seen: 1,365 times

Last updated: 16 Aug '10, 13:44

Copyright © 2005-2012 Splunk, Inc. All rights reserved.