input: Write a function to extract specific features from a given JSON string. If the input JSON string is empty or invalid, return None.
  
  def feature_extraction(input_str):
      if not input_str:
          return None
  
      try:
          import json
          data = json.loads(input_str)
      except json.JSONDecodeError:
          return None
  
      features = {
          "id": data["id"],
          "title": data["title"],
          "body_len": len(data["body"])
      }
  
      return features
  
  assert feature_extraction('{"id":111,"title":"This is a sample title","body":"This is a sample body text"}') == {"id": 111, "title": "This is a sample title", "body_len": 26}
  assert feature_extraction('{}') == None
  assert feature_extraction('{"id":111,"title":"This is a sample title","body":"This is a sample body text", "extra_field":"extra"}') == {"id": 111, "title": "This is a sample title", "body_len": 26}
  assert feature_extraction('invalid json string') == None
output: def feature_extraction(input_str):
      if not input_str:
          return None
  
      try:
          import json
          data = json.loads(input_str)
      except json.JSONDecodeError:
          return None
  
      features = {
          "id": data.get("id"),
          "title": data.get("title"),
          "body_len": len(data.get("body", ""))
      }
  
      return features if all(features.values()) else None