# What is the grok pattern for this jenkins log?

**URL:** <https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this-jenkins-log/216357>\
**Category:** Logstash\
**Created:** [January 24, 2020, 5:07am UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this-jenkins-log/216357 "2020-01-24T05:07:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![souravatta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/souravatta/32/61388_2.png) [@souravatta](https://discuss.elastic.co/u/souravatta)\
**Post date:** [January 24, 2020, 5:07am UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this-jenkins-log/216357/1 "2020-01-24T05:07:22Z")

</div>

Hi,

Can you please help me with the grok pattern for this jenkins sample data or log. The log is only a single line.

`hudson.slaves.CommandLauncher launch\nSEVERE: Unable to launch the agent for dot-dewsttlas403-ci\njava.io.IOException: Failed to create a temporary file in /opt_shared_git/dot_slave/jenkins_slave/workspace\n\tat hudson.util.AtomicFileWriter.<init>(AtomicFileWriter.java:144)\n\tat hudson.util.AtomicFileWriter.<init>(AtomicFileWriter.java:109)\n\tat hudson.util.AtomicFileWriter.<init>(AtomicFileWriter.java:84)\n\tat hudson.util.AtomicFileWriter.<init>(AtomicFileWriter.java:74)\n\tat hudson.util.TextFile.write(TextFile.java:116)\n\tat jenkins.branch.WorkspaceLocatorImpl$WriteAtomic.invoke(WorkspaceLocatorImpl.java:264)\n\tat jenkins.branch.WorkspaceLocatorImpl$WriteAtomic.invoke(WorkspaceLocatorImpl.java:256)\n\tat hudson.FilePath$FileCallableWrapper.call(FilePath.java:3042)\n\tat hudson.remoting.UserRequest.perform(UserRequest.java:212)\n\tat hudson.remoting.UserRequest.perform(UserRequest.java:54)\n\tat hudson.remoting.Request$2.run(Request.java:369)\n\tat hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n\tSuppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to dot-dewsttlas403-ci\n\t\tat hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)\n\t\tat hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)\n\t\tat hudson.remoting.Channel.call(Channel.java:957)\n\t\tat hudson.FilePath.act(FilePath.java:1069)\n\t\tat hudson.FilePath.act(FilePath.java:1058)\n\t\tat jenkins.branch.WorkspaceLocatorImpl.save(WorkspaceLocatorImpl.java:254)\n\t\tat jenkins.branch.WorkspaceLocatorImpl.access$500(WorkspaceLocatorImpl.java:80)\n\t\tat jenkins.branch.WorkspaceLocatorImpl$Collector.onOnline(WorkspaceLocatorImpl.java:561)\n\t\tat hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:697)\n\t\tat hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:432)\n\t\tat hudson.slaves.CommandLauncher.launch(CommandLauncher.java:154)\n\t\tat hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:294)\n\t\tat jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)\n\t\tat jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)\n\t\tat java.util.concurrent.FutureTask.run(Unknown Source)\n\t\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\t\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\t\tat java.lang.Thread.run(Unknown Source)\nCaused by: java.io.IOException: No space left on device\n\tat java.io.UnixFileSystem.createFileExclusively(Native Method)\n\tat java.io.File.createTempFile(File.java:2024)\n\tat hudson.util.AtomicFileWriter.<init>(AtomicFileWriter.java:142)\n\t... 15 more\n`

I am only interested to extract the following from the above logs. **agent status** , **agent name**

Expected Result: **agent status:** Unable **agent name:** dot-dewsttlas403-ci

---

<div class="post-metadata">

**Author:** ![Ramicoh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramicoh/32/61017_2.png) [@Ramicoh](https://discuss.elastic.co/u/Ramicoh)\
**Post date:** [February 5, 2020, 2:17am UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this-jenkins-log/216357/2 "2020-02-05T02:17:15Z")

</div>

Assuming the required fields appears at the beginning of the log:

`Grok: SEVERE:\s%{WORD:agent_status}.*\s+for\s+(?<agent_name>[^\\n]+).`

Parameter name cannot contain white space, so I used underscore (`_`). You can always use "pure" regex like in the 2nd extraction.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 4, 2020, 2:25am UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this-jenkins-log/216357/3 "2020-03-04T02:25:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
