Refine your search:

I want the series to sort as 1,2,3,10,11,12 not 1,10,11,12,2,3. The sort functions do not seem to have any effect when used in this context:

... | sort -num(myfield)

I don't see any examples of using the sort functions in the documentation or other questions. :(

I have also tried:

... | sort by num(myfield)
... | sort num(myfield)

Halp!

asked 30 Aug '11, 15:09

hulahoop's gravatar image

hulahoop ♦
2.6k141151
accept rate: 40%

edited 30 Aug '11, 15:50


2 Answers:

i'm not sure why this isn't working for you. it seems to be fine for me...

... | sort +|- num(<numeric field>)

did you have a particular search/example that wasn't working? i can help you with that and perhaps add that as an example to the topic. thanks.

link

answered 30 Aug '11, 16:29

sophy's gravatar image

sophy
669118
accept rate: 31%

edited 30 Aug '11, 16:33

You can also use the fields command to specify the fields.

| fields "column1" col2 col3 col4

link

answered 27 Jun '12, 00:23

brettcave's gravatar image

brettcave
35379
accept rate: 29%

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:

×396
×230
×55

Asked: 30 Aug '11, 15:09

Seen: 1,831 times

Last updated: 27 Jun '12, 00:23

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