<?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 regex help with field extraction in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/543267#M4944</link>
    <description>&lt;P&gt;I could use some expert assistance with a regex for breaking down a custom user-agent field in an IIS log into component fields while avoiding a conflict with other fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We run software that uses IIS as a file server, and the software injects a custom user-agent value into the IIS log with every request.&amp;nbsp; Here is a sample of the user agent:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;JTDI+(JDMS+1.0.11.2.20200807;+Win10+10.0;+229.0/62/-1;Branch|UnitType|System|City|ST|SiteIDOverride|SvrType|2.5;C8F7504F064E;UTA-AVD)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The IIS log is space delimited, so all of that lands in the cs_user_agent field just fine.&amp;nbsp; I made a sort of running mess of extracting the subfields.&amp;nbsp; Within the string are subfields delimited by semicolon, and sub-subfields delimited by / and |.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are my separate extractions, in order as the fields appear in the string:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^[^\(\n]*JTDI\+\((?P&amp;lt;jkversion&amp;gt;[^;]+)
^[^;\n]*;(?P&amp;lt;os&amp;gt;[^;]+)
^(?:[^;\n]*;){2}(?P&amp;lt;freespace&amp;gt;[^/]+)
^(?:[^;\n]*;){2}\+\d+\.\d+/(?P&amp;lt;pending&amp;gt;\d+)
^(?:[^;\n]*;){3}(?P&amp;lt;SiteDescription&amp;gt;[^;]+)
^(?:[^;\n]*;){4}(?P&amp;lt;MAC&amp;gt;[^;]+)
^(?:[^;\n]*;){5}(?P&amp;lt;cs_hostname&amp;gt;[^\)]+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Technically after the 'pending' field there should be a 'hits' field (represented by the -1 above), but we don't use it, so I didn't bother extracting it.&lt;BR /&gt;&lt;BR /&gt;So my problem is the parentheses.&amp;nbsp; If a filename shows up in the cs_uri_stem field that includes them, like filename(copy1).txt, the () throw off my jkversion and cs_hostname extractions, because I don't know how to accommodate the possible existence of parentheses outside the cs_user_agent field.&lt;BR /&gt;&lt;BR /&gt;So I guess my question is two-fold.&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; I know my overall user-agent extraction should be a single transform instead of all separate field extractions, but I'm not sure how to tie them all together because I couldn't see a way to extract strings like that in the field extractor interface in Splunk.&lt;/P&gt;&lt;P&gt;2) How can I fix my regex so that parentheses appearing in other fields don't break my jkversion and cs_hostname extractions?&lt;/P&gt;&lt;P&gt;Help?&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 22:41:30 GMT</pubDate>
    <dc:creator>DaClyde</dc:creator>
    <dc:date>2021-03-10T22:41:30Z</dc:date>
    <item>
      <title>regex help with field extraction</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/543267#M4944</link>
      <description>&lt;P&gt;I could use some expert assistance with a regex for breaking down a custom user-agent field in an IIS log into component fields while avoiding a conflict with other fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We run software that uses IIS as a file server, and the software injects a custom user-agent value into the IIS log with every request.&amp;nbsp; Here is a sample of the user agent:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;JTDI+(JDMS+1.0.11.2.20200807;+Win10+10.0;+229.0/62/-1;Branch|UnitType|System|City|ST|SiteIDOverride|SvrType|2.5;C8F7504F064E;UTA-AVD)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The IIS log is space delimited, so all of that lands in the cs_user_agent field just fine.&amp;nbsp; I made a sort of running mess of extracting the subfields.&amp;nbsp; Within the string are subfields delimited by semicolon, and sub-subfields delimited by / and |.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are my separate extractions, in order as the fields appear in the string:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^[^\(\n]*JTDI\+\((?P&amp;lt;jkversion&amp;gt;[^;]+)
^[^;\n]*;(?P&amp;lt;os&amp;gt;[^;]+)
^(?:[^;\n]*;){2}(?P&amp;lt;freespace&amp;gt;[^/]+)
^(?:[^;\n]*;){2}\+\d+\.\d+/(?P&amp;lt;pending&amp;gt;\d+)
^(?:[^;\n]*;){3}(?P&amp;lt;SiteDescription&amp;gt;[^;]+)
^(?:[^;\n]*;){4}(?P&amp;lt;MAC&amp;gt;[^;]+)
^(?:[^;\n]*;){5}(?P&amp;lt;cs_hostname&amp;gt;[^\)]+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Technically after the 'pending' field there should be a 'hits' field (represented by the -1 above), but we don't use it, so I didn't bother extracting it.&lt;BR /&gt;&lt;BR /&gt;So my problem is the parentheses.&amp;nbsp; If a filename shows up in the cs_uri_stem field that includes them, like filename(copy1).txt, the () throw off my jkversion and cs_hostname extractions, because I don't know how to accommodate the possible existence of parentheses outside the cs_user_agent field.&lt;BR /&gt;&lt;BR /&gt;So I guess my question is two-fold.&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; I know my overall user-agent extraction should be a single transform instead of all separate field extractions, but I'm not sure how to tie them all together because I couldn't see a way to extract strings like that in the field extractor interface in Splunk.&lt;/P&gt;&lt;P&gt;2) How can I fix my regex so that parentheses appearing in other fields don't break my jkversion and cs_hostname extractions?&lt;/P&gt;&lt;P&gt;Help?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 22:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/543267#M4944</guid>
      <dc:creator>DaClyde</dc:creator>
      <dc:date>2021-03-10T22:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: regex help with field extraction</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/543632#M4946</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1358"&gt;@DaClyde&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use below one line regex if you can send a few samples which creates problem I can make change to capture them also;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^[^\(\n]*JTDI\+\((?P&amp;lt;jkversion&amp;gt;[^;]+);(?P&amp;lt;os&amp;gt;[^;]+);(?P&amp;lt;freespace&amp;gt;[^\/]+)\/(?P&amp;lt;pending&amp;gt;[^\/]+)\/(?P&amp;lt;hits&amp;gt;[^;]+);(?P&amp;lt;SiteDescription&amp;gt;[^;]+);(?P&amp;lt;MAC&amp;gt;[^;]+);(?P&amp;lt;cs_hostname&amp;gt;[^\)]+)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 13 Mar 2021 11:03:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/543632#M4946</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-03-13T11:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: regex help with field extraction</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/544078#M4950</link>
      <description>&lt;P&gt;So far, so good.&amp;nbsp; I implemented the combined field extractions, and it is at least working as good as before.&amp;nbsp; Here are some sample events, a few that are normal, and a few that cause problems:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2021-03-16 21:01:40 10.2.3.4 HEAD /configs/army/ACD-ABNGAASN1/configs.xml - 443 usr-1125 169.31.11.142 JTDI+(JDMS+1.0.11.2.20200807;+WinServer+2016+10.0;+345.6/0/-1;West|AA|ACD|Hotelville|AL|ACD-ABNGAASN2|ACDSVR|2.5;C8F7504F05CE;NGABA-ACN-05) - 304 0 0 325 393 192.168.81.70 close - -&lt;BR /&gt;2021-03-16 17:02:54 10.2.3.4 GET /Army/acd/faq/ACN+v1.1.6.2002(20R2)+Release+Updates.pdf - 443 usr-1125 169.31.11.142 JTDI+(JDMS+1.0.11.2.20200807;+WinServer+2016+10.0;+345.5/285/-1;West|AA|ACD|Hotelville|AL|ACD-ABNGAASN2|ACDSVR|2.5;C8F7504F05CE;NGABA-ACN-05) - 200 0 0 5905224 399 2984 192.168.81.70 close - -&lt;BR /&gt;2021-03-15 17:11:08 10.2.3.4 GET /Army/lift/safety/AMAM/2020/GEN-20-AMAM-06+(2ND+UPDATE).pdf - 443 usr-1125 169.31.11.140 JTDI+(JDMS+1.0.11.2.20200807;+WinServer+2016+10.0;+345.6/104/-1;West|AA|ACD|Hotelville|AL|ACD-ABNGAASN2|ACDSVR|2.5;C8F7504F05CE;NGABA-ACN-05) - 200 0 0 274234 408 15 192.168.81.70 close - -&lt;BR /&gt;2021-03-15 17:11:06 10.2.3.4 GET /Army/lift/safety/AMAM/2020/GEN-20-AMAM-06+(2ND+UPDATE).docx - 443 usr-1125 169.31.11.143 JTDI+(JDMS+1.0.11.2.20200807;+WinServer+2016+10.0;+345.6/105/-1;West|AA|ACD|Hotelville|AL|ACD-ABNGAASN2|ACDSVR|2.5;C8F7504F05CE;NGABA-ACN-05) - 200 0 0 51828 409 0 192.168.81.70 close - -&lt;BR /&gt;2021-03-15 17:07:05 10.2.3.4 GET /Army/utility/safety/AMAM/2020/GEN-20-AMAM-06+(2ND+UPDATE).pdf - 443 usr-1125 169.31.11.141 JTDI+(JDMS+1.0.11.2.20200807;+WinServer+2016+10.0;+345.6/205/-1;West|AA|ACD|Hotelville|AL|ACN-ABNGAASN1|ACDSVR|2.5;C8F7504F05CE;NGALA-ACN-02) - 200 0 0 274234 406 15 192.168.81.70 close - -&lt;BR /&gt;2021-03-15 17:07:02 10.2.3.4 GET /Army/utility/safety/AMAM/2020/GEN-20-AMAM-06+(2ND+UPDATE).docx - 443 usr-1125 169.31.11.142 JTDI+(JDMS+1.0.11.2.20200807;+WinServer+2016+10.0;+345.6/206/-1;West|AA|ACD|Hotelville|AL|ACD-ABNGAASN2|ACDSVR|2.5;C8F7504F05CE;NGALA-ACN-02) - 200 0 0 51828 407 15 192.168.81.70 close - -&lt;BR /&gt;2021-03-15 17:03:00 10.2.3.4 GET /Army/gen/safety/AMAM/2020/GEN-20-AMAM-06.pdf - 443 usr-1125 169.31.11.140 JTDI+(JDMS+1.0.11.2.20200807;+WinServer+2016+10.0;+345.7/285/-1;West|AA|ACD|Hotelville|AL|ACD-ABNGAASN2|ACDSVR|2.5;C8F7504F05CE;NGABA-ACN-05) - 200 0 0 274234 405 0 192.168.81.70 close - -&lt;BR /&gt;2021-03-15 17:02:57 10.2.3.4 GET /Army/gen/safety/AMAM/2020/GEN-20-AMAM-06.docx - 443 usr-1125 169.31.11.143 JTDI+(JDMS+1.0.11.2.20200807;+WinServer+2016+10.0;+345.7/286/-1;West|AA|ACD|Hotelville|AL|ACD-ABNGAASN2|ACDSVR|2.5;C8F7504F05CE;NGABA-ACN-05) - 200 0 0 51828 406 0 192.168.81.70 close - -&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 22:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/544078#M4950</guid>
      <dc:creator>DaClyde</dc:creator>
      <dc:date>2021-03-16T22:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: regex help with field extraction</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/544112#M4951</link>
      <description>&lt;P&gt;Below regex is working on all sample events;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;JTDI\+\((?P&amp;lt;jkversion&amp;gt;[^;]+);(?P&amp;lt;os&amp;gt;[^;]+);(?P&amp;lt;freespace&amp;gt;[^\/]+)\/(?P&amp;lt;pending&amp;gt;[^\/]+)\/(?P&amp;lt;hits&amp;gt;[^;]+);(?P&amp;lt;SiteDescription&amp;gt;[^;]+);(?P&amp;lt;MAC&amp;gt;[^;]+);(?P&amp;lt;cs_hostname&amp;gt;[^\)]+)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 Mar 2021 05:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/544112#M4951</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-03-17T05:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: regex help with field extraction</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/544210#M4954</link>
      <description>&lt;P&gt;Beautiful, this works perfectly.&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 14:54:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/regex-help-with-field-extraction/m-p/544210#M4954</guid>
      <dc:creator>DaClyde</dc:creator>
      <dc:date>2021-03-17T14:54:01Z</dc:date>
    </item>
  </channel>
</rss>

