- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ubuntu 10.10 / Splunk 4.2.1 / App: *nix 4.2
Yesterday we upgraded to the newest version of Splunk (4.2.1) and upgraded *nix app (4.2). Splunkd is now reporting the following errors:
- message from "/opt/splunk/etc/apps/unix/bin/interfaces.sh" awk: line 1: syntax error at or near }
- message from "/opt/splunk/etc/apps/unix/bin/interfaces.sh" awk: line 1: syntax error at or near else
- message from "/opt/splunk/etc/apps/unix/bin/interfaces.sh" awk: line 1: syntax error at or near ,
I'm unable to identify what the syntax problem is. I've compared the interfaces.sh file on our server to what is posted on the web and they are the same. Is anyone else experiencing this problem?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cyndiback, I don't have a specific fix at this time, but this is a known issue logged as (SOLN-1032). Please submit your own case to support@splunk.com for tracking.
Moderator edit:
UPDATE: this issue later became SPL-41361, and should be fixed in the next maintenance release of the app. In the meantime, the glorious Vainstein has provided a patch for ifconfig.sh (sorry about the lines wrapping):
# diff interfaces.sh interfaces-mod.sh
41,42c41,42
< SPEED=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, /([0-9]+)([Mm]bps)/, array)) {print array[1] "Mb/s"} else { if (match($i,/[Mm]bps/)) {print $(i-1) "Mb/s"} } } }' | sed '$!d'`
< DUPLEX=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, /([\-\_a-zA-Z0-9]+)([Dd]uplex)/, array)) {print array[1]} else { if (match($i, /[Dd]uplex/)) {print $(i-1)} } } }' | sed 's/[-_]//g; $!d'`
---
> SPEED=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, "([0-9]+)([Mm]bps)")) {print $i} else { if (match($i, "[Mm]bps")) {print $(i-1) "Mb/s"} } } }' | sed '$!d'`
> DUPLEX=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, "([\-\_a-zA-Z0-9]+)([Dd]uplex)")) {print $i} else { if (match($i, "[Dd]uplex")) {print $(i-1) } } } }' | sed 's/[-_]//g; $!d'`
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On debian :
- install gawk
- modify interfaces.sh :
-replace awk by gawk
- modify the line : CMD='ifconfig'. by removing the dot at the end of this line
it works for me after that
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
we are still having this issue even after upgrading the *nix app to the latest version. anyone?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm also experiencing this same issue my Ubuntu server
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is caused by mawk. Debian installs mawk instead of gawk by default. Install gawk instead and the error will go away.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tried resetting to gawk and rebooted machine...This did not fix the error.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
+1 having this issue on a new install, further information would be greatly appreciated...
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am seeing the same error as well
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cyndiback, I don't have a specific fix at this time, but this is a known issue logged as (SOLN-1032). Please submit your own case to support@splunk.com for tracking.
Moderator edit:
UPDATE: this issue later became SPL-41361, and should be fixed in the next maintenance release of the app. In the meantime, the glorious Vainstein has provided a patch for ifconfig.sh (sorry about the lines wrapping):
# diff interfaces.sh interfaces-mod.sh
41,42c41,42
< SPEED=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, /([0-9]+)([Mm]bps)/, array)) {print array[1] "Mb/s"} else { if (match($i,/[Mm]bps/)) {print $(i-1) "Mb/s"} } } }' | sed '$!d'`
< DUPLEX=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, /([\-\_a-zA-Z0-9]+)([Dd]uplex)/, array)) {print array[1]} else { if (match($i, /[Dd]uplex/)) {print $(i-1)} } } }' | sed 's/[-_]//g; $!d'`
---
> SPEED=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, "([0-9]+)([Mm]bps)")) {print $i} else { if (match($i, "[Mm]bps")) {print $(i-1) "Mb/s"} } } }' | sed '$!d'`
> DUPLEX=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, "([\-\_a-zA-Z0-9]+)([Dd]uplex)")) {print $i} else { if (match($i, "[Dd]uplex")) {print $(i-1) } } } }' | sed 's/[-_]//g; $!d'`
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is working fine on my linux host, and on Solaris for me. 4.2.1 as well.
