Skip to content

Instantly share code, notes, and snippets.

@marianogg9
Created February 10, 2014 19:41
Show Gist options
  • Save marianogg9/8922747 to your computer and use it in GitHub Desktop.
Save marianogg9/8922747 to your computer and use it in GitHub Desktop.
"check":{
"output":"HTTP CRITICAL: HTTP/1.1 503 Service Temporarily Unavailable - pattern not found - 593 bytes in 0.001 second response time |time=0.000500s;;;0.000000 size=593B;;;0\n",
bla bla
I need to get the first text before the "|". Tried this:
def foo
@event['check']['output'].split(' | ').first
end
puts foo
And I still get the full text of "output": HTTP CRITICAL: HTTP/1.1 503 Service Temporarily Unavailable - pattern not found - 593 bytes in 0.001 second response time |time=0.000500s;;;0.000000 size=593B;;;0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment