<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to extract values for specific token from pipe delimited log in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-values-for-specific-token-from-pipe-delimited-log/m-p/560199#M92604</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have some application logs in the following format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR | 2021-07-20 06:55:54 EDT | Field1 = Value1 | Field2 = Value2 | Long Error String - Another long error string | Field3 = Value3 | ... | ... &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most of the tokens are in Field=Value format and Splunk is able to extract them just fine except the portion where there is no Field listed. Just two different error strings separated by a " - ".&amp;nbsp; (These strings may contain other special characters as part of the error)&lt;/P&gt;&lt;P&gt;Is there a way I can extract both of them separately, e.g. signature_1, signature_2 without disturbing rest of the extractions? I would prefer doing this with props/transforms.&lt;/P&gt;&lt;P&gt;I was thinking of using "DELIMS" option but not sure how to target just that particular part of the log.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2021 12:37:22 GMT</pubDate>
    <dc:creator>att35</dc:creator>
    <dc:date>2021-07-20T12:37:22Z</dc:date>
    <item>
      <title>How to extract values for specific token from pipe delimited log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-values-for-specific-token-from-pipe-delimited-log/m-p/560199#M92604</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have some application logs in the following format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR | 2021-07-20 06:55:54 EDT | Field1 = Value1 | Field2 = Value2 | Long Error String - Another long error string | Field3 = Value3 | ... | ... &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most of the tokens are in Field=Value format and Splunk is able to extract them just fine except the portion where there is no Field listed. Just two different error strings separated by a " - ".&amp;nbsp; (These strings may contain other special characters as part of the error)&lt;/P&gt;&lt;P&gt;Is there a way I can extract both of them separately, e.g. signature_1, signature_2 without disturbing rest of the extractions? I would prefer doing this with props/transforms.&lt;/P&gt;&lt;P&gt;I was thinking of using "DELIMS" option but not sure how to target just that particular part of the log.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 12:37:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-values-for-specific-token-from-pipe-delimited-log/m-p/560199#M92604</guid>
      <dc:creator>att35</dc:creator>
      <dc:date>2021-07-20T12:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values for specific token from pipe delimited log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-values-for-specific-token-from-pipe-delimited-log/m-p/560269#M92612</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/179828"&gt;@att35&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try inline rex as below, and props.conf shall be deployed to SearchHead.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex "^\w+\s+\|\s+\d+-\d+-\d+\s+\d+:\d+:\d+\s+\w+\s+\|\s+\w+\s+=\s+.+?\|\s+\w+\s+=\s+.+?\|(?&amp;lt;signature_1&amp;gt;.+?)\-(?&amp;lt;signature_2&amp;gt;.+?)\|"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;#props.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[your_sourcetype]
EXTRACT-sign = ^\w+\s+\|\s+\d+-\d+-\d+\s+\d+:\d+:\d+\s+\w+\s+\|\s+\w+\s+=\s+.+?\|\s+\w+\s+=\s+.+?\|(?&amp;lt;signature_1&amp;gt;.+?)\-(?&amp;lt;signature_2&amp;gt;.+?)\|&lt;/LI-CODE&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;An upvote would be appreciated and Accept solution if this reply helps!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 23:34:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-values-for-specific-token-from-pipe-delimited-log/m-p/560269#M92612</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-07-20T23:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values for specific token from pipe delimited log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-values-for-specific-token-from-pipe-delimited-log/m-p/560351#M92620</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/163730"&gt;@venkatasri&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. Regex was able to extract both parts but I noticed that since there were several&amp;nbsp; -&amp;nbsp; characters within signature_1, it was splitting the string way before the actual&amp;nbsp; -&amp;nbsp; that separates the two. Since both strings are also separated by white spaces, I was able to get around that using following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"^\w+\s+\|\s+\d+-\d+-\d+\s+\d+:\d+:\d+\s+\w+\s+\|\s+\w+\s+=\s+.+?\|\s+\w+\s+=\s+.+?\|(?&amp;lt;signature_1&amp;gt;.+?)\s\-\s(?&amp;lt;signature_2&amp;gt;.+?)\|"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 13:02:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-values-for-specific-token-from-pipe-delimited-log/m-p/560351#M92620</guid>
      <dc:creator>att35</dc:creator>
      <dc:date>2021-07-21T13:02:16Z</dc:date>
    </item>
  </channel>
</rss>

